Convert unsupported colour space to RGB on imagick #756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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