Skip to content

Imaging tool that groups together similarly colored pixels.

Notifications You must be signed in to change notification settings

alecgoedinghaus/imnum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Numbering Tool

This tool scans each pixel of a given image and groups similar pixels together by labelling them with the same number. The "similarity" is determined by a user-defined tolerance of the pixel's RGB closeness, with the logic:

Imnum will then generate a pdf of the labelled picture. It can either do this with all of the groups labelled on a single picture, or it can split each group into its own page to better see each separate number. Great for pixel art, painting, or general image analysis.

Examples

The following are example outputs of analyzed images from the video game Minecraft (with a tolerance of 20).

All-in-One Expanded View
bust_output-1.png
bust-01.png bust-02.png
bust-03.png bust-47.png
sunset_output-1.png
sunset-01.png sunset-02.png
sunset-03.png sunset-20.png

Usage

After cloning the git repository, run the following commands:

(For first time pipenv use)

pip install pipenv

Followed by:

cd imnum
pipenv install

Once your environment is set up, you can start the venv and run the script:

pipenv shell
python imnum.py /path/to/image.png

Imnum accepts most common image formats. See the skimage documentation for more details.

Flags can also be set to further customize the output.

  • -f or --font_size to change the font size of the overlayed numbers. Defaulted at 6.
  • -e or --expand to have the expanded view output.
  • -s or --scale to downscale the image prior to analyzing the pixels.
  • -t or --tolerance to adjust how similar the pixel colors can be for them to be grouped in the same category. Defaulted at 25.

For example, to get the above outputs, I used:

python imnum.py bust.png -s 10 -t 20
python imnum.py sunset.png -s 10 -t 20

for the standard view, and:

python imnum.py bust.png -s 10 -t 20 -e
python imnum.py sunset.png -s 10 -t 20 -e

for the expanded view.

About

Imaging tool that groups together similarly colored pixels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages