Sometimes it is requires to increase an image size without changing its pixels i.e. increase the size of a file without changing a quality, dimension or resolution of the image or photo.
You may need this for example in some applications or web-services that don’t allow to upload images if their size is less than some minimum, e.g. less than 50KB.
There is no need to search for some online “photo size increaser” or install any additional software as Windows, macOS and Linux users can easily increase an image size using the built-in command-line tools.
In this note i will show how to increase an image size without changing its pixels in Windows, macOS and Linux from the command line.
Cool Tip: Remove EXIF data from images & photos in Linux! Read more →
Increase Image Size
Windows
To increase an image size without changing its pixels in Windows, you can use the fsutil
command that is available both in a Windows command prompt (CMD) and in a PowerShell.
To start the Windows command prompt or PowerShell, press the ⊞ Win + R to launch the “Run” dialog and execute the cmd
or powershell
correspondingly.
Make a backup of the image file which size you want to increase:
C:\> copy photo.jpg photo-orig.jpg
Use the fsutil
command to increase the image file size by padding it with zeros:
C:\> fsutil file seteof <file> <size_in_bytes>
Examples of the image file size increasing:
# Increase the image size to 50KB C:\> fsutil file seteof photo.jpg 50000 # Increase the image size to 100KB C:\> fsutil file seteof photo.jpg 100000 # Increase the image size to 200KB C:\> fsutil file seteof photo.jpg 200000 # Increase the image size to 2MB C:\> fsutil file seteof photo.jpg 2000000
macOS, Linux
To increase an image size without changing its pixels in macOS and Linux, you can use the dd
command from the terminal.
Make a backup of the image file which size you want to increase:
$ cp photo.jpg photo-orig.jpg
Use the following syntax of the dd
command to increase the image file size by padding it with zeros:
$ dd if=/dev/zero bs=<block_size> count=<number_of_blocks> | cat >> <file>
For example, to increase a size of the 20KB image:
# Check the original image size $ du -sh photo.jpg 20K photo.jpg # Add 1KB*30=30KB to increase the 20KB image size to 50KB $ dd if=/dev/zero bs=1K count=30 | cat >> photo.jpg $ du -sh photo.jpg 52K photo.jpg # Add 10KB*8=80KB to increase the 20KB image size to 100KB $ dd if=/dev/zero bs=10K count=8 | cat >> photo.jpg $ du -sh photo.jpg 100K photo.jpg # Add 10KB*18=180KB to increase the 20KB image size to 200KB $ dd if=/dev/zero bs=10K count=18 | cat >> photo.jpg du -sh photo.jpg 200K photo.jpg # Add 1MB*2=2MB increase the 20KB image size to 2MB $ dd if=/dev/zero bs=1M count=2 | cat >> photo.jpg $ du -sh photo.jpg 2,1M photo.jp
Note that in all the examples above we increase the size of the image file by padding it with zeros, that means that we increase the actual size of the file without impacting the quality, dimension or resolution of the image or photo.
Had to fill a form and was stuck with resolution issue. Thank you so much, it worked. Really grateful.