Stripping color profiles from images for use on the web?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dunglan
Posts: 1
Joined: 2013-05-09T16:48:39-07:00
Authentication code: 6789

Stripping color profiles from images for use on the web?

Post by dunglan »

I am using imagemagick for resizing images for use on the web so that they are faster to load.

One of the problems I have is that we have images that contain massive color profiles that can be have half a megabyte in size. When these images are re-sized the file is still huge since that half megabyte color profile is embedded into the re-sized image.

For web use can safely strip these profiles or can we normalize that massive color profiles to smaller profile?

We dont have any control of the color profiles in the image since they are submitted to the application by 3rd parties.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stripping color profiles from images for use on the web?

Post by fmw42 »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Stripping color profiles from images for use on the web?

Post by snibgo »

If you merely strip the profile, browsers will assume the image is sRGB. But the image might not have been sRGB.

It might be safer to:

Code: Select all

convert {blah blah} -profile sRGB.icc -strip outfile
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Stripping color profiles from images for use on the web?

Post by anthony »

-resize does not remove ANY profile info. Nor does most other IM operations.

The -strip and -thumbnail does remove most profiles, but leaves the color profile so images still display correctly. For example the EXIF cammera info, and Photoshop profiles is removed.

sRGB is the default profile and PNG will not save images with that profile. As such the solution snibgo gives will handle the color profile.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply