Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip META but Preserve ICC Color Profiles #278

Open
terryupton opened this issue Oct 7, 2019 · 4 comments
Open

Strip META but Preserve ICC Color Profiles #278

terryupton opened this issue Oct 7, 2019 · 4 comments

Comments

@terryupton
Copy link

Is there any way Imager could be configured to strip the meta data but only keep the ICC Color Profiles? I believe this would still result in slightly smaller sizes, one of the benefits of removing the META data, but still ensuring the image is correct.

I have a series of black and white images that are getting darkened when I set 'removeMetadata' => true, but setting it to false is adding a good 30KB to the larger images.

Here are some comparisons.

Original Image
JTQ2018-87

'removeMetadata' => false
JTQ2018-87_W2400_H3300_Mcrop_P60-2-27-18_E_grayscale-
313KB
1164 × 1601px
Colour space: Grey
Colour Profile: Generic Gray Gamma 2.2 Profile

'removeMetadata' => true
JTQ2018-87_W2400_H3300_Mcrop_P60-2-27-18_E_grayscale-
289KB
1164 × 1601px
Colour space: Grey

I am not entirely sure where the Colour space: grey is getting set? is this something Imager/iMagick is doing?

@bossanova808
Copy link

This should really be the default option for all these image optimisiation things - stripping ICC profiles is not a lossless operation (especially in a world no colour managed web browsers as we now live in).

@terryupton You can generally solve this at your end for now by using your own option string for the optimisations e.g. jpegoptim use something like:

'optionString' => '--strip-com --strip-exif --strip-iptc --all-progressive',

@aelvan
Copy link
Owner

aelvan commented Oct 12, 2019

I'll put this on my todo-list for the next version of Imager I'm working on, and see what I can come up with. At the moment I'm using the built-in strip method in Imagine, which doesn't allow for any fine-grained removal - it's all or nothing - so I'll have to roll my own functionality then.

@terryupton Just to be clear, you're only transforming the image using width/height and similar, or are you also doing effects: { grayscale: true } on them?

@bossanova808 That's a nice hack. :)

@terryupton
Copy link
Author

terryupton commented Oct 12, 2019

@aelvan no effects just size transforms.
Interestingly is does add _greyscale- to the end of the transformed filename, so it seems like something else might be occurring behind the scenes or as a bug?

@bossanova808
Copy link

(I am using effects....can't deal with transforms without some image sharpening happening!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants