Skip to content

Conversation

@fhoehl
Copy link

@fhoehl fhoehl commented Jan 21, 2024

I needed to export TIFF images with CMYK. Even though I was setting imageColorSyncProfileData with macOS's Generic CMYK profile, the final output file did not have the colour profile set, and the encoded colours were in the RGB space.

I would happily invest more time and add tests if this PR looks valuable for the project!

This PR is related to #284 and #531.

@justvanrossum
Copy link
Collaborator

Hi, thank you so much for starting this! We are certainly interested in integrating this, and we would like you to encourage to write some tests. It is possible this will turn out harder than it should be. Let us know if you get blocked, then we can try to sort this out.

The "hyphenation" change in baseContext.py seems out of place. We would prefer a separate PR for that.

@chrisjansky
Copy link

Any progress on this please? Saving CMYK images would be very useful.

@justvanrossum If tests are the blocking issue here I can try writing those if you could elaborate on what those should be 🙏

@justvanrossum
Copy link
Collaborator

You never responded to the hyphenation feedback: what does that have to do with this PR?

There are test scripts in tests/drawBotScripts/, these tend to produce images, which are verified against the contents of tests/data/. It would be great if you could add that.

@fhoehl
Copy link
Author

fhoehl commented Jun 22, 2025

@chrisjansky, I'm glad you find this PR useful. I must admit that I forgot about this PR, and a year has passed 😄. Let me see if I can add the test this week!

@justvanrossum, thanks for the pointers. I will remove the hyphenation, which is totally unrelated.

colorSpaceName=colorSpaceName,
)

if "imageColorSyncProfileData" in options:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this instead be handled by the _makeBitmapImageRep() helper function, with an additional keyword argument?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is also handled by line 174: imageData = imageRep.representationUsingType_properties_(self._saveImageFileTypes[ext], properties).

I added this because it initially didn't work as expected, but it now does.

@fhoehl fhoehl marked this pull request as ready for review June 24, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants