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

Add spot colour channel rendering #48

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

EugeneVert
Copy link
Contributor

@EugeneVert EugeneVert commented Jun 12, 2023

Adds rendering of spot color channels by default, a set_render_spot_colour method to enable/disable their rendering and a render_spot_colour method to get the value of that flag in JxlRenderer

Rendering of spot channels onto color channels is disabled during conformance testing since they are tested as separate channels

fixes #15

before: after:
before after

@EugeneVert EugeneVert force-pushed the spot-colour-channels branch 2 times, most recently from e297c30 to 5c22c28 Compare June 12, 2023 13:54
@@ -135,6 +135,7 @@ impl<R: Read> JxlImage<R> {
image_header: &self.image_header,
embedded_icc: self.embedded_icc.as_deref(),
ctx,
render_spot_colour: true,
Copy link
Owner

Choose a reason for hiding this comment

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

We might need to prevent rendering spot color channels if the image is grayscale.

Copy link
Contributor Author

@EugeneVert EugeneVert Jun 12, 2023

Choose a reason for hiding this comment

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

Сan we use red color from spot channel as luma and just ignore green and blue as it is now with grayscale images?

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure about the semantics of spot color channels on grayscale images; bitstream does not forbid this, but tricolor spot color channel doesn't make sense with grayscale ICC profile. Let's go with emitting a warning for this time.

crates/jxl-render/src/lib.rs Outdated Show resolved Hide resolved
@EugeneVert EugeneVert force-pushed the spot-colour-channels branch 4 times, most recently from 66cd781 to 1f2c883 Compare June 13, 2023 08:51
crates/jxl-oxide/src/lib.rs Outdated Show resolved Hide resolved
crates/jxl-render/src/lib.rs Outdated Show resolved Hide resolved
@EugeneVert EugeneVert force-pushed the spot-colour-channels branch from 1f2c883 to fe614fa Compare June 13, 2023 09:15
@EugeneVert EugeneVert force-pushed the spot-colour-channels branch from fe614fa to 1a0e535 Compare June 13, 2023 09:27
Copy link
Owner

@tirr-c tirr-c left a comment

Choose a reason for hiding this comment

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

Great work, thanks!

@tirr-c tirr-c merged commit 2ec5bd9 into tirr-c:main Jun 13, 2023
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.

Spot channel rendering
2 participants