-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Alfio Puglisi wrote:
On 12/2/06, Lars Aronsson lars@aronsson.se wrote:
For example, the image http://runeberg.org/img/nfad/0670.4.png is 240 kbytes in 150 dpi 16-level grayscale PNG but only 200 kbytes in 600 dpi bitonal TIFF G4. The difference between 150 dpi grayscale and 600 dpi bitonal becomes very clear when you try to print the page on a 600 or 1200 dpi laser printer.
Well, you should compare apples to apples. The image you specified becames only 58 kbytes wen saved as 1-bit (bitonal) PNG.
Nice. :)
And bitmapped formats like PNG and TIFF have no concept of "dpi"- that's an external manipulation made by the printing program.
On the contrary, these formats do have such a concept; it's metadata usually stored in the file header, describing the ratio between the pixel-level representation and the physical size of the scanned source or the expected printed output.
For PNG, DPI can be indicated in a pHYs data chunk: http://www.w3.org/TR/PNG/#11pHYs
For TIFF, the XResolution, YResolution, and ResolutionUnit fields indicate this data.
In both formats this is optional; not every image necessarily has a physical size that makes sense. However the resolution fields can also indicate the aspect ratio for non-square pixels, which are a reality for instance when working in various video formats.
You need to compare images with the same pixel sizes.
Generally one would want to do so, yes. :)
A comparison between two files of different resolution and color depth may well be a valid one at times, but it's not relevant if you're trying to compare the relative file sizes of the same raster data in different file formats.
- -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)