Skip to content

Error saving PNG after CAST #3609

Answered by jcupitt
jfconekta asked this question in Q&A
Aug 13, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @jfconekta,

We improved the rules for when to write 16-bit PNG in 8.10 (I think it was). You now need to set the image interpretation to RGB16 or GREY16 to write a 16-bit PNG.

In your code, try:

  out = out.cast(VIPS_FORMAT_USHORT).copy(VImage::option ()->set ("interpretation", "grey16"));

Of course the image will look very dark, I expect you know.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jfconekta
Comment options

Answer selected by jfconekta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #3605 on August 14, 2023 09:37.