"... and no one shall work for money, and no one shall work for fame; But each for the joy of the working, and each, in his separate star, shall draw the thing as he sees it, for the god of things as they are"

-Kipling

 

ThumbNailGenerator:
Fast, Semi-Automated, Generation of Cropped, Scaled and Thumbnail Images from Sections of Multiple Images

Summary

One of my projects required that portions of numerous images be reduced to a 600x600 pixel jpg and that a subsequent 100x100 pixel thumbnail should be created. In other words, 600x600 pixel jpeg images needed to be cropped out of the interesting sections of a existing sequence of 6000x4000 pixel images, then saved to disk and a thumbnail taken. Furthermore, the interesting portions of those images were not of consistent size and hence needed to be suitably scaled. It also needed to be possible to repeat the crop, scale and thumbnail operation multiple times on any one image (depending on the context) or to skip images entirely if need be.

There were over 1000 images which needed to be suitably processed in that way. Performing such copy-paste and scaling operations with standard image processing software (such as GIMP) would be exceptionally repetitive and would take an improbably long time. Clearly there was a need for a point and click semi-automated solution - thus the ThumbNailGenerator software was created.

The purpose of the ThumbNailGenerator software is to enable the user to open up a large scale image, choose an area to convert to a 600x600 pixel format, save the resulting cropped and scaled image to a directory and then either automatically move to the next image or, alternately, extract a subsequent cropped and scaled image from the same original. A 100x100 pixel thumbnail image is also created for each 600x600 image.

This project was created to meet a specific purpose for a given set of input and output requirements. The software is not polished and has not been productionised. This means that it is not as smooth and generic as might be desired - there are, however, no known bugs. In addition, please realize that now that the software has done the job for which it was intended, it is essentially over as far as the author is concerned.

The ThumbNailGenerator software is pretty much only offered as a starting point for others who may wish to adapt it. If you do make enhancements that would be useful to others (and which you would like to share) please generate a pull request on the Github repo.

How to Use the ThumbNailGenerator Software

  1. Set the input directory. All images will be read from this directory.
  2. Set the output directory. All 600x600 images and 100x100 thumbnails will be written to this directory. This can be the same as the input directory.
  3. Use the Get Image button to open a jpeg image of 6000x4000 in size and display it in the window in the upper right. You can open other size images but the view does not adjust or scroll to see all of the image if the size is larger.
  4. Click with the mouse in the window in the upper right and you will see a red square on the image centered on the point where you clicked. The red square is called the view port and is the boundary of the 600x600 image. The contents of the view port will be displayed in full size in the larger window at left.
  5. The view port nudge control can move the view port window in units of 1, 3, 5 or 10 pixels for fine movement control.
  6. The scale factor control will make the view port window smaller or larger and hence display greater or lesser resolution in the 600x600 image in the left hand window. The mouse wheel also works for this.
  7. When the image on the left contains the contents you wish, press the Save Image button to save the 600x600 image and 100x100 image to the output directory. If the Auto Load Next on Save option is checked, the next image file (alphabetically) in the directory will be loaded for processing.
  8. If the Save + Dup Image button is pressed, the image is saved and the viewport can be moved to a new point on the existing image in order to create a new 600x600 image and thumbnail. The filenames used on output are adjusted with an a,b,c,d... etc. suffix to indicate this. When complete, you can use the Skip Image button to move to the next image.

What the ThumbNailGenerator Software Does Not Do

The Source Code

The ThumbNailGenerator Application is open source and is released under the MIT License. You can download, clone, fork or create pull requests at the following address:

https://github.com/OfItselfSo/ThumbNailGenerator

Download the Binary

The best option is to acquire the code from the Github repo (see above) and compile it yourself (Visual Studio 2019 C# was used for development). However, if you just want to use the code as-is, a pre-compiled binary ThumbNailGenerator.exe file is available below. There is no installer - just unzip it where you want it and run.

Acknowledgements

The icon used for the ThumbNailGenerator app is "Snail", part of the lovely Glass Zoo set by sirea.

License

The contents of this web page are provided "as is" without any warranty of any kind and without any claim to accuracy. Please be aware that the information provided may be out-of-date, incomplete, erroneous or simply unsuitable for your purposes. Any use you make of the information is entirely at your discretion and any consequences of that use are entirely your responsibility. All source code is provided under the terms of the MIT License.