question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TrueColor / sRGB image saved as 8-bit Indexed

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title
  • [x ] I have verified that I am using the latest version of Magick.NET

System Configuration

  • Magick.NET version: Magick.NET-Q16-HDRI-x64-OpenMP
  • Environment (Operating system, version and so on): Windows 10

Question

I have an image created using Clut(). The source colors are very few. Now when I save as a PNG with ColorSpace set to sRGB and ColorType set to TrueColor, the image is still saved as an indexed 8-bit image. AFAIK, this only happens when the color range in the image is small. Am I doing something wrong?

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
t246246commented, Mar 7, 2020

I’m loading a RGB 8 bit gray image, the ColorType is set to TrueColor. When I write out the image as a tif I get a grayscale (single channel) image, and the ColorType has changed to Grayscale.

You’ll need -define colorspace:auto-grayscale=off. In Magick.NET use SetAttribute("colorspace:auto-grayscale", "false");

2reactions
FrogsInSpacecommented, May 28, 2019

Just stumbled over the same issue: images containing only few colors were saved to Png8, despite ColortType.TrueColor etc… in the original image. But i found that there is s specific MagickFormat.Png00 type which saves the png using the same bitdepth / colortype as the original. I would have assumed that the naming would be the other way arround: MagickFormat.Png doing no optimization/conversion at all , and a specific name doing them … Nevertheless , my issue was solved by using MagickFormat.Png00

Read more comments on GitHub >

github_iconTop Results From Across the Web

images types; indexed color vs true color, 8-bits graphics
The RGB color-value is much larger, compared to the index used by an indexed color image. An RGB value contains 24 bits; an...
Read more >
8-Bit Palette, Grayscale, and Truecolor - Web Design in a ...
8-Bit Palette Images. Like GIFs, PNGs can be saved as 8-bit indexed color. This means they can contain up to 256 colors, the...
Read more >
Converting truecolor RGB image to indexed colors
I want to convert a 24bit RGB image (8 bit for each channel) 8 bit using an indexed color palette. My initial idea...
Read more >
True Colour and Indexed Colour Bitmaps - YouTube
This is the second in a sequence of videos about images. It begins by reviewing the impact of resolution (pixel density) and colour...
Read more >
jpg to bmp grayscale - colorspace still sRGB - Page 2
I guess that proves that bmp does not support true grayscale or bilevel. The best one can do is palette with two colors,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found