Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_SaveImage less then 32BPP
#8
(02-17-2026, 04:52 PM)Petr Wrote:
(02-17-2026, 04:36 PM)mdijkens Wrote: Thanks Petr,
Second one works good.
But anyhow it is a one time generate PNG to print at 1200dpi (highest quality with fine lines)

Still wondering why _SaveImage always reverts to 32BPP instead of taking image mode-property into account

I assume it's because of speed. It depends on the library being used, as some can't handle anything less than 24/32-bit images. That’s why they convert them to 32-bit. I’m basing this on my experience with BMP, which also doesn't support everything it potentially could. However, I’ve released my own versions where that support is included.

That is correct. We use stb_image_write internally, and it can only output in 32 bpp (or whatever the highest bit depth is for the target format). Because of that, we always run the image through an internal color format conversion step before saving.
What Steve mentioned above is also true. When saving to GIF, the underlying library automatically converts the image to 8 bpp before writing it out. GIF technically supports formats with fewer than 8 bpp, but those variants aren't used.

BTW, this behavior is documented in the _SAVEIMAGE wiki.
Reply


Messages In This Thread
_SaveImage less then 32BPP - by mdijkens - 02-17-2026, 12:47 PM
RE: _SaveImage less then 32BPP - by Petr - 02-17-2026, 04:09 PM
RE: _SaveImage less then 32BPP - by mdijkens - 02-17-2026, 04:36 PM
RE: _SaveImage less then 32BPP - by SMcNeill - 02-17-2026, 04:50 PM
RE: _SaveImage less then 32BPP - by Petr - 02-17-2026, 04:52 PM
RE: _SaveImage less then 32BPP - by ahenry3068 - 02-17-2026, 05:03 PM
RE: _SaveImage less then 32BPP - by a740g - 02-17-2026, 09:45 PM
RE: _SaveImage less then 32BPP - by SMcNeill - 02-17-2026, 04:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)