Background:

Two weeks ago, we need to test an image cropping tool’s functionality. This cropping tool is used by a web site to processing the images uploaded by user, it can accept images with up to 100 MB size. So we need to collect many format images in many different sizes.

But how to create an extra-large image, say size in 60 MB, 86MB or even 99 MB? MSPaint.exe will not be response with image files which in size larger than 20 MB. (at least with 2G memory machine)

Solution:

Photoshop has much much better performance than MSPaint.exe, you can create images as large as you want. But if you really use it, you will find that creating large bmp files is just a piece of cake. However, creating large jpg files is kind of a challenge task. You will find that the jpg compressing algorithm is so powerful if you try to create a 100 MB jpg file.

But you can still try to paste many high resolution images to the single image file to produce a large file by using Photoshop. You need to repeat saving and checking file size many times to produce an ideal size image.

Quick Solution:

Hey, there is another quick approach to produce a specified size image.

You can put a zipped file into the image bits. It sounds like kind of cheating. But it really works!

Steps:

  1. Put jpg and zipped file in the same folder, for example, D:\pet.jpg and D:\zippedFile.zip
  2. Open cmd and change path to D: disk
  3. Enter the command:
    • copy /b <originalImageFileName>+<zippedFileName> <newImageFileName>
    • For example: copy /b pet.jpg+zippedFile.zip newImage.jpg
  4. Done. You can check in D: disk, find the newImage.jpg is out there.

Because you can always easily find a specified size zip file, so via the above approach, you can quickly produce an image file with the exact size you want.