On Mon, 13 Oct 2008 19:01:14 -0700, Jon Harrop <jo*@ffconsultancy.com>
wrote:
[...]
>PNG is always compressed.
Here is an excerpt from the PNG specification about its support for
uncompressed images:
I guess I should have been more specific. My point was that .NET always
tries to compress PNGs by default. You'd have to intentionally disable
compression, and off the top of my head, I don't recall any codec settings
that you can use with PNG that would do that (there's an
EncoderValue.CompressionNone enumeration value, but AFAIK you can only use
that with TIFF files).
"It is possible to store uncompressed data by using only uncompressed
deflate blocks (a feature normally used to guarantee that deflate does
not
make incompressible data much larger)." -
http://www.w3.org/TR/PNG-Rationale.html
Sure, but .NET doesn't do that.
Of course, that point does raise the question: have you compared an
explicitly uncompressed PNG generated with software that _does_ give you
that level of control with the output from .NET? For uncompressed images,
the data in the file should be byte-for-byte identical (or nearly so, if
there are some header differences or something minor like that).
Or at the very least, compared the PNG output size from .NET to the
nominal uncompressed size of your data? That would give you direct,
reliable information about just how much, if at all, .NET is compressing
your image.
Since you haven't posted the code here, whatever I or anyone else might
write about what .NET is doing in your case is pure speculation. Garbage
in, garbage out.
[...]
I just wanted to confirm that .NET provides only very rudimentary support
for PNG encoding.
..NET provides only very rudimentary support for PNG encoding.
Pete