/** * @param string $imgFile Имя файла с исображением * @return bool|resource */ public static function openImg($imgFile) { $img = Img::open($imgFile); if ($img) { $img = Divider::changeBackgroundBrightness($img); $colorIndexes = Divider::getColorsIndexTextAndBackground($img); self::$background = imagecolorsforindex($img, $colorIndexes['background']); $img = Divider::addBorder($img, self::$background['red'], self::$background['green'], self::$background['blue']); } return $img; }