You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jakub Valenta 7f327f9740 Use dataclasses and reformat code 2 years ago
docs Improve README 2 years ago
image_marker Use dataclasses and reformat code 2 years ago
.gitignore Initial commit 5 years ago
LICENSE Initial commit 5 years ago Initial commit 5 years ago
Makefile Add Makefile 2 years ago
NOTICE Update license NOTICE 2 years ago Improve README 2 years ago
image-marker Use dataclasses and reformat code 2 years ago
setup.cfg Add isort config 2 years ago Use dataclasses and reformat code 2 years ago
tox.ini Use dataclasses and reformat code 2 years ago

Image Marker

A graphical program to mark rectangular areas in a batch of images and save their coordinates as a CSV. Optionally, add a text note to each of the images. Optimized for a fast workflow.

Image Marker screenshot

Output CSV format:

<image path> <left px> <top px> <width px> <height px>


./test_images/building.jpg 350 237 909 547
./test_images/canal.jpg 530 533 1075 252

This is all Image Marker does. You can do whatever you want with the output CSV. One obvious option is to crop the images according to the marks. You can use image-crop for that.


pip install --user --upgrade .


  1. Put all the images you want to mark in a single directory.

  2. Run Image Marker:

    image-marker ./my_directory --marks my_marks.csv --output my_output.csv --box-ratio 1.33 --box-padding 0.1

    The positional argument specifies the directory to load the images from.

    The option --marks specifies the CSV file path, where the coordinates of the marked rectangles will be saved.

    The option --output specifies the CSV file path, where the post-processed coordinates will be saved. More on that later.

  3. A window will appear with the first image in the directory. Use the mouse to draw a rectangular mark. The output CSV files are saved immediately.

    Image Marker screenshot - mark

    If you're not happy with the mark position or size, draw it again. The previously drawn rectangle will disappear.

  4. Use the right arrow key to advance to the next image.

    You can also go back using the left arrow key.

  5. Type any characters on your keyboard to add a text note to an image. It will appear in blue by the bottom edge of the window. You can delete what you've typed using the backspace key.

    Image Marker screenshot - note

  6. Quit the program by pressing the esc key.

Mark post-processing

By default the values stored in the --marks and --output CSV files are the same.

However, it is possible to make some automatic adjustments to your marks. In this case, the original marks will be stored in the --marks CSV file and the post-processed marks in the --output CSV file.

There is currently one post-processing option:


If you want to create a set of marks that all have the same aspect ratio, you can use the option --box-ratio to automatically draw a box around each mark with a specified aspect ratio. The box will be drawn symmetrically around the marked area as a green rectangle. If the box doesn't fit in the image, it will be moved in the image.

Image Marker screenshot - box

You can also add padding to the box using the option --box-padding. It is defined as a fraction of the marked rectangle width. For instance --box-padding 0.15 will result in a 30 px padding for a 200 px wide mark.

Image Marker screenshot - box with padding


  • right or down or enter: show next image
  • left orup: show previous image
  • left mouse click and drag: draw a mark
  • left mouse click (no drag): delete current mark
  • esc: exit the program (all marks are automatically saved)
  • letter and number keys: add text note to current image
  • backspace: delete the last character of the text note


image-marker --help


Feel free to remix this piece of software. See NOTICE and LICENSE for license information.