Skip to content
\n

I'm using Image::thumbnail() to optimize user uploads to my CMS. Should I be converting color profiles to sRGB as well? I need to make sure images display correctly in the browser but I'm not sure if this is already taken care of under the hood. Or if it's necessary.

\n

These are the options I'm using at the moment:

\n
        'jpeg' => [\n            'quality' => 80,\n            'keep' => 'none',\n            'optimize_coding' => true,\n            'export_profile' => 'srgb', // <------------ is this correct / necessary?\n        ],
\n

Also, are the options the same for JPG2000 files? Just wondering if I need to handle them differently or if I can use the same settings.

\n

Cheers

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Setting the export profile does the colour conversion, so if you set p3, for example, you'll get an image in p3 space and with a p3 profile attached to it.

\n

Yes, it's export_profile in PHP.

\n

Yes, you can use the colour options for jp2k load and save, they just won't do anything, since profile support in jp2k is so poor. You can't set things like optimise_coding for jp2k though.

","upvoteCount":0,"url":"https://github.com/libvips/php-vips/discussions/266#discussioncomment-12426213"}}}

Image::thumbnail and color profile normalisation #266

Answered by jcupitt
binaryfire asked this question in Q&A
Discussion options

You must be logged in to vote

Setting the export profile does the colour conversion, so if you set p3, for example, you'll get an image in p3 space and with a p3 profile attached to it.

Yes, it's export_profile in PHP.

Yes, you can use the colour options for jp2k load and save, they just won't do anything, since profile support in jp2k is so poor. You can't set things like optimise_coding for jp2k though.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@jcupitt
Comment options

@binaryfire
Comment options

@jcupitt
Comment options

Answer selected by binaryfire
@binaryfire
Comment options

@binaryfire
Comment options

@jcupitt
Comment options

@binaryfire
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants