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

Convert unsupported colour space to RGB on imagick #756

Closed
wants to merge 2 commits into from

Conversation

jleckie
Copy link

@jleckie jleckie commented Dec 28, 2020

This removes the limitation that only CMYK and RGB are supported on imagemagick. To avoid having to add colourspace support for the dozens of different systems supported by imagemagick, it simply converts other colour spaces to SRGB for simplicity when dealing with colour in imagine.

This will cause problems, if you wanted to handle colour profiles before the conversion, but it seems to work well enough for my use cases.

This has the added benefit of allowing HEIC files to be supported and should resolve #755. HEIC files often are in either dci-p3 (Apple Phones) or CIELAB (Nokia?), or YCbCr even.

In order to get HEIC support I needed to build my own imagemagick and imagick libraries from source. There is a few guides around online for this, obviously you will need to customise for your own environment.
https://gist.github.com/caingougou/e2ebe70057270c208d57ed13ec186b7e

@ausi
Copy link
Contributor

ausi commented Feb 13, 2021

I integrated part of this in my HEIC/AVIF pull request #759.

Do you have any test images that use something different than Imagick::COLORSPACE_YCBCR (that are not RGB or CMYK)?

I think it would be more safe to only add support for YCBCR for now.

@jleckie
Copy link
Author

jleckie commented Feb 19, 2021

Closing my PR as it has been superseded by @ausi

@jleckie jleckie closed this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add support for HEIC format
2 participants