Colour profile and JPEG 2000

3 visualizaciones (últimos 30 días)
Elizabeth Allen
Elizabeth Allen el 28 de Oct. de 2013
Respondida: Prateekshya el 16 de Oct. de 2024
Hi,
I have a set of sRGB profiled TIFF files, which I am converting to JPEG2000 in MATLAB using imwrite. Will the colour space be used during the compression, and will the images remain in the sRGB colour space?
Thanks Liz

Respuestas (1)

Prateekshya
Prateekshya el 16 de Oct. de 2024
Hello Elizabeth,
When you convert sRGB profiled TIFF files to JPEG2000 in MATLAB using the imwrite function, the color space information is typically preserved, but there are some important considerations to keep in mind:
  • sRGB Profile: If your TIFF files contain an embedded sRGB ICC profile, MATLAB will not automatically embed this profile into the JPEG2000 files. However, the pixel data itself will remain in the sRGB color space unless explicitly converted.
  • Compression and Color Space: The compression process itself (using JPEG2000 in this case) does not inherently change the color space of the image data. The image will remain in the sRGB color space unless you perform a color space conversion before writing the file.
  • MATLAB imwrite Function: The imwrite function in MATLAB does not automatically embed color profiles when writing JPEG2000 files. If maintaining the ICC profile is critical, you may need to handle this separately using additional tools or libraries that support ICC profile embedding in JPEG2000.
Recommendations:
  • Verify and Embed ICC Profile: If you need to ensure that the ICC profile is preserved, consider using external tools or libraries that support ICC profile embedding in JPEG2000 files. MATLAB’s imwrite does not natively support this feature.
  • Color Space Conversion: If you need to convert the image to a different color space, you can use MATLAB functions like rgb2xyz, rgb2lab, etc., before writing the file.
  • Post-Processing Tools: After converting the images in MATLAB, you can use tools like Adobe Photoshop, ImageMagick, or specialized JPEG2000 libraries to verify and embed ICC profiles if necessary.
Here is a basic example of how you might convert a TIFF file to JPEG2000 in MATLAB:
% Read the TIFF image
tiffImage = imread('input_image.tiff');
% Write the image to JPEG2000 format
imwrite(tiffImage, 'output_image.jp2', 'CompressionRatio', 10);
I hope this helps!

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by