For a network experiment I am conducting, I require image files of arbitrary size.
I am lost on how to create such files. I require 5MB, 10MB and 20MB files in JPEG, PNG and PDF format.
In my first attempt at generating these files it became clear that due to the compression schemes of these formats, it’s not possible (or at least I don’t know how) to generate files of arbitrary size by just specifying resolution of blank files.
Is there a quick (programmatic?) method by which I could generate these files?
Edit: I am investigating creating arbitrarily sized dummy files, but if there is a way to create actual JPEG, PNGs or PDFs that have the correct internal format, that would be ideal.
The resolution doesn’t change the number of pixels, just the display size of a pixel — increasing resolution makes the display larger, but doesn’t make the file larger.
If you make a JPEG that repeats the same information over and over again it will get bigger — the compression is on a 8×8 cell basis — if you have more cells, you’ll have more data. To make them bigger, encode with quality set to 100. Another thing, JPEG strips out luminance on a cell basis, so variation in hue compresses worse than variation in luminance.
I used my company’s product, DotImage, to create a 10mb jpg with this code. You could download an eval and try it out, or do the same with your image SDK.
If you make the image pixel size larger, the JPEG file will get larger. You could also add in meta-data, but it’s hard to get a big file with just meta-data as there are some size limitations.
PDF is the easiest — just make a big page with uncompressed image and keep adding pages — it will get big fast — there’s no compression unless you turn it on. You can do this easily in DotImage with the
PdfEncoder— just give it a list of jpgs in aFileSystemImageSource— code not shown as to not bore everyone, but I’d be happy to provide it to anyone that wants it — just call Atalasoft and ask for me (or open a support case and reference this question.