image icon indicating copy to clipboard operation
image copied to clipboard

image colors changed after saving the image

Open dmitriykivkin opened this issue 5 years ago • 10 comments

For some jpg images(see attached 'initial image' file) colors being changed after performing make -> save sequence. Example code:

    protected $imageManager;
    
    public function __construct(.....)
    {
        ....
        $this->imageManager = new ImageManager();
        ....
    }

   public function doSave(){
       $this->imageManager->make($imagePath)->save('/path/to/folder/image.jpg');
   }

After performing this operation(with both gd and imagick), it seems like the image after processing is increased in color saturation(see attached 'result image' file). RESULT_IMAGE INITIAL_IMAGE

dmitriykivkin avatar Sep 16 '19 14:09 dmitriykivkin

Intervention applies few parameters by default, like sharpen for example. You can setter this parameters to 0 if you dont want to apply them.

DanielGilB avatar Sep 24 '19 18:09 DanielGilB

Intervention applies few parameters by default, like sharpen for example. You can setter this parameters to 0 if you dont want to apply them.

I have the same problem as @dmitriykivkin.

@DanielGilB can you please give an example where to change these parameters?

mrdernst avatar Feb 01 '20 22:02 mrdernst

You can read doc to see all parameters and their default values.

An example is sharpen. Method accepts values between 0 and 100. Default: 10

// create new Intervention Image
$img = Image::make('public/foo.jpg');

// sharpen image
$img->sharpen(15);

DanielGilB avatar Feb 02 '20 13:02 DanielGilB

I have the same problem with the saturation

it should look like this when i create thumbnails: sliced-tomato-pieces-in-saladb

but i get this:

sliced tomato pieces in salad - 640x427

does anyone know what i have to do so that the colors do not lose their saturation? If I set the sharpness to 0 it has no effect on the color

motosha avatar Jul 14 '20 10:07 motosha

@motosha in my case such an issue occurred only with images based on CMYK color model and after converting to RGB the problem is gone

dmitriykivkin avatar Jul 14 '20 12:07 dmitriykivkin

The pictures are not in CMYK they are in RGB

motosha avatar Jul 14 '20 19:07 motosha

I found out that it has to do with the ICC color profiles, but still no idea how to solve that.

Am Di., 14. Juli 2020 um 21:39 Uhr schrieb Salah Ait Mokhtar < [email protected]>:

Hello I'm glad that you answer, how is the situation in Venezuela are you and your family doing well? Just wanted to say that I understand your situation and I hope that normality will return to your life soon.

The pictures are not in CMYK they are in RGB I guess the problem is to target somewhere here vendor\intervention\image\src\Intervention\Image\Gd\Commands

Best wishes Salah

motosha avatar Jul 14 '20 21:07 motosha

Same problem here. Any solution?

blursolo avatar Feb 24 '21 15:02 blursolo

Same problem, did not found any solution yet

monirulislamccr avatar Mar 08 '22 09:03 monirulislamccr

Same problem, did not found any solution yet

Solution is to use "imagick" driver instead of default "gd".

marispro avatar Mar 08 '22 09:03 marispro

This seems to be an issue with Version 2 of Intervention Image ignoring color profiles.

Version 3 of Intervention Image supports color profiles. But only with the Imagick driver. Unfortunately, it is still not possible to interpret color profiles with the GD library and therefore also not with Intervention Image and the driver for this library.

See https://github.com/Intervention/image/issues/707#issuecomment-1870271306

olivervogel avatar Dec 27 '23 16:12 olivervogel