1

In our own software we support loading of different kind of images, including but not limited to .bmp, .gif, .tiff, .jpg, and .png.

In code I've noticed that some of images might be using color indexing , but it looks like one of our image manipulation library is missing some of patches (lost upon a time).

I would like to test our software against such odd image formats (we are loading .png and .jpg ok), can you recommend me some set of images, where I can download a lot of different image file formats with different saving options.

So color indexed .png's / .tiff's / .bmp's would be included at least.

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
TarmoPikaro
  • 4,723
  • 2
  • 50
  • 62
  • You want an images with diff extensions?I think MS paint has that option ..? – Bhawna Jain Sep 14 '17 at 06:30
  • We are not supporting .diff extension at the moment, so no need, but I guess from collection perspective it would be good to have everything in one place, if someone ever needs them. – TarmoPikaro Sep 14 '17 at 06:36
  • I think she meant "different". – I.Newton Sep 14 '17 at 06:45
  • So as many different file formats as possible, different in sense that their file format differs. RGB, color indexing, file format year, encoding, etc... – TarmoPikaro Sep 14 '17 at 07:05
  • Why not just use Imagemagick to create all those formats from any given image? – fmw42 Aug 15 '18 at 03:15
  • Not directly related, but can be useful for other image testing: sample images to test Exif metadatahttps://github.com/ianare/exif-samples – Ben Butterworth Apr 01 '21 at 16:08

3 Answers3

5

As @piglet suggests, you should create test cases to ensure coverage. You could use something like ImageMagick and here is a very basic script that generates a bunch of files in different formats - much more is possible, of course, but you need to specify your own test cases.

This creates a test JPEG file:

magick xc:red xc:lime +append \( xc:blue xc:magenta +append \) -append -resize 600x600 test.jpg

enter image description here

Here is a script if you want a variety of formats:

#!/bin/bash
files=(test.gif test.jpg test.bmp PNG8:testPNG8.png PNG24:testPNG24.png PNG32:testPNG32.png PNG48:testPNG48.png PNG64:testPNG64.png test.tif)

for f in "${files[@]}"; do
   magick xc:red xc:lime +append \( xc:blue xc:magenta +append \) -append -resize 600x600 "$f"
done

And here are the output files:

-rw-r--r--@ 1 mark  staff  1080138 14 Sep 09:26 test.bmp
-rw-r--r--@ 1 mark  staff   109366 14 Sep 09:26 test.gif
-rw-r--r--@ 1 mark  staff    24457 14 Sep 09:26 test.jpg
-rw-r--r--@ 1 mark  staff  2160264 14 Sep 09:26 test.tif
-rw-r--r--@ 1 mark  staff    62181 14 Sep 09:26 testPNG24.png
-rw-r--r--@ 1 mark  staff    68153 14 Sep 09:26 testPNG32.png
-rw-r--r--@ 1 mark  staff   545890 14 Sep 09:26 testPNG48.png
-rw-r--r--@ 1 mark  staff   550337 14 Sep 09:26 testPNG64.png
-rw-r--r--@ 1 mark  staff     6747 14 Sep 09:26 testPNG8.png

And here are all the test images montaged together:

enter image description here

You probably need to cycle through:

  • formats,
  • bit depths (8,16,32),
  • colourspaces,
  • palettised/non-palettised,
  • transparent/opaque,
  • compression types,
  • interlaced/non-interlaced,
  • ... and so on
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • I would prefer ready made collection, not something I need to generate by myself. I can give some space on google drive, if you want to go through and upload images there, but I would prefer existing images made by different applications. Something similar exists for video's: https://stackoverflow.com/questions/35956425/collection-of-video-samples-with-different-codecs Why we cannot have same for images ? – TarmoPikaro Sep 14 '17 at 19:06
3

I did some searching, but I didn't find any comprehensive image format test archive; what I did find was limited:

I suspect that another place to look would be the test images used for the build tests (CI testing) for an open source project: an image using project (like Chromium or Firefox) or a multi-format image processing library (like ImageMagick).

Things the image library should include at least:

  • Wide variety of formats (modern and obsolete; vector, animated, 3d and raster; image depth and colour spaces etc)
  • Malformed files with invalid data structures (variety for each format, including existing malware, truncated files)
  • Polyglot files - a file that is simultaneously an image file and another file type (gifar, discussion, thinkfu)
  • DoS files, causing either excessive CPU (recursive image format) or excessive memory usage (e.g. highly compressed black image with insanely big dimensions)
  • Formats with different meta data including invalid meta data (e.g. EXIF malware)

I can find good examples of test suites for each particular format (e.g. png, bmp)

robocat
  • 5,293
  • 48
  • 65
0

Although your question is off-topic I want to give you some advice.

Websearch will yield anything useful if something is out there, so asking here doesn't make too much sense.

What you plan to do is: us a random collection of images in various formats and hope that your software will handle them properly.

What do you want to tell your user if your software fails? "Sorry mate that particular use case was not part of the random image collection I found online for testing?"

What you should do: Create test samples for every format your software claims to support. For each supported format make sure you implement a test sample for every aspect of the format specification!

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • Well - there exists such samples for video - https://stackoverflow.com/questions/35956425/collection-of-video-samples-with-different-codecs - why we cannot have the same for images ? I believe such collection already exists, only needs to be found. – TarmoPikaro Sep 14 '17 at 19:03
  • @TarmoPikaro as long as you ensure that you have every possible aspect of those specifications in your test data set it does not matter where you get it from. best way to be sure is to create your own test data. – Piglet Sep 15 '17 at 04:21