Saving images with wide gamut color profile

I was doing some colorimetry and wanted to use MATLAB to generate some images. If I save an image to my disk using the imwrite() function, it produces an image in the sRGB color format. That's not good enough for me as my monitor supports P3, which contains many more colors. Is there a way to write an image in MATLAB with a specific color profile that isn't sRGB?

 Akzeptierte Antwort

Brandon
Brandon am 25 Dez. 2025

1 Stimme

Here's what I ended up doing:
I wrote the image as a png file in regular sRGB format and then used a command line tool to attach the color profile to the image:
imwrite(img, "test.png");
setenv('PATH', [getenv('PATH') ':/opt/homebrew/bin']);
system('exiftool -"icc_profile<=DisplayP3.icc" test.png');
Here /opt/homebrew/bin is where exiftool is installed on my mac and DisplayP3.icc is the color profile which I downloaded from ICC's website.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 24 Dez. 2025

1 Stimme

The only thing I see is using imwrite() to write tiff with colorspace cielab or icclab; or to use the tiff library to do the same thing.

Kategorien

Produkte

Gefragt:

am 24 Dez. 2025

Beantwortet:

am 25 Dez. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by