0

I am running ubuntu 64-bit on a virtual machine and took a screenshot of a part of my desktop using the shortcut Shift+Print. The .png file consists of 1500x1078 pixels and has a total size of 30,1 kB.

To get a better understanding, I asked myself how to arrive at 30,1 kB?

Adopting a sloppy calculation, (1500*1078*bit_depth/(8*1024)), gives approximately 197 kB, assuming a bit_depth of 1, which is probably much higher such that the size is even larger and quite far away from 30,1 kB.

I have to admit that I am a newbie in this topic and there is an easy explanation for my question. Any input is appreciated!

1
  • this has nothing to do with unix so it's off-topic here. It's purely the result of the compression
    – phuclv
    Commented Sep 25, 2021 at 11:02

1 Answer 1

2

The data in PNG files is compressed, i.e. redundant information is removed. Screenshots in particular tend to contain runs of identical pixels and other features which can be compressed, so their file sizes are usually much smaller than a one-to-one pixel storage would require.

4
  • This makes sense. Just one relating question: I insert the .png file in a vector graphics program (inkscape) and save it therein as .pdf with the option 'Resolution for rasterization (dpi) = 96'. Is the dpi value associated with a degredation of quality? I thought the dpi setting is mainly relevant for printing only.
    – simonw
    Commented Sep 23, 2021 at 8:55
  • That setting applies to exported filter effects; see the Inkscape manual. Whether there’s any degradation in quality depends on how you’re processing the PNG in the document, and how big the PNG is (geometrically) in relation to the page size (and thus how one pixel in the PNG translates to the output). You might also find that the screenshot quality is degraded in the PDF if it’s compressed using JPEG compression rather than “deflate” compression (but I don’t know where the relevant settings are in Inkscape). Commented Sep 23, 2021 at 9:09
  • Great. Under settings->properties of the saved pdf file, there is no information related to which compression technique was used? At least I can not find anything.
    – simonw
    Commented Sep 23, 2021 at 9:21
  • Valid PDF files always have defined page sizes. That's why DPI gets introduced.
    – svin83
    Commented Jun 4, 2022 at 18:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .