Re: flattening: two ways, two different results
Bob Friesenhahn <[email protected]> Thu, 31 Aug 2023 08:17:53 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 31 Aug 2023, frechefuchs via Graphicsmagick-help wrote: > >> % gm convert logo: -type TrueColorMatte -operator matte assign 50% -verbose info:- > > But what is that? > >> gm convert logo: PNG32:- | gm convert - -operator matte assign 50% -verbose info:- >> /tmp/gmx7zyAz PNG 654x418+0+0 DirectClass 8-bit 52.2Ki 0.010u 0m:0.046921s (5.6Mi pixels/s) >> Image: /tmp/gmx7zyAz >> Format: PNG (Portable Network Graphics) >> Geometry: 654x418 >> Class: DirectClass >> Type: true color with transparency >> Depth: 9 bits-per-pixel component <== here >> Channel Depths: >> Red: 8 bits >> Green: 8 bits >> Blue: 8 bits >> Opacity: 9 bits <== here > > Shouldn't that be 8 bits? A Q16 build could produce a number which does not fit perfectly in 8 bits. 32768 does not scale down perfectly to 8 bits. That said, I have suspected for a while that my depth estimation algorithm needs improvement. If you are going to pipe PNG to PNG then using this syntax will likely help. At least with modern GM, it avoids using a temporary file: gm convert logo: PNG32:- | gm convert PNG:- -operator ... The only reason why a temporary file is used is due to a need to read the input twice in order to detect the file format. If you specify the file format, that can be avoided. Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt