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

Some images color saturation is reduced after running the image through imgp. #15

Closed
jgoslow opened this issue Jul 1, 2017 · 4 comments

Comments

@jgoslow
Copy link

jgoslow commented Jul 1, 2017

I was using imgp to resize a bunch of product images, and found that one or two lost it's luster (i.e. the color saturation was reduced). I've included an example of the original and new image - curious if there's any improvement to the tool that could solve for this - or if there was a setting I missed.

140174_campaign copy_imgp
140174_campaign copy

@jarun
Copy link
Owner

jarun commented Jul 2, 2017

RGB and HSL are two representations of the same image. If you want to resize an image to 50%, the original colors are not retained. It gets smaller by a factor of two in each dimension, and the color of each pixel will be the average of four pixels from the original. Depending on the colors in the image, you may sense loss of glossiness.

Your original image is 2100x3000, 3.21MB. Converted to 1000x1429, 124KB.

There is the quality option for save which can take care of this to some extent:

image.save(name, quality=95)

Default is 75. However, the last time I tried it several images became larger. ;) I can expose it though. Do you think it's a good idea?

@jarun
Copy link
Owner

jarun commented Jul 2, 2017

The quality option doesn't affect PNG images, is default 75 for JPEG and 80 for WebP etc. (note: we don't support WebP yet). I believe the reason I omitted this in the first place was it's not uniform across the formats. That still holds true.

Closing the issue.

@jarun jarun closed this as completed Jul 2, 2017
@jarun
Copy link
Owner

jarun commented Jul 2, 2017

Additional note: we need uniform supported functionality because imgp is optimized to be a batch utility. If things that don't work across the board start getting added, we would start receiving and keep spending time on issues those are not our problems.

@ananyajana
Copy link
Collaborator

Quality is supported for JPEGs at d4d0353.

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants