Skip to main content

Create exact size of an image

I want a picture with exactly 5 MB, what are 5.000.000 Bytes.

truncate -s 5000000 size.png

It fills the image with zeros up to the wanted size.