This is an annotation app for x-ray images. The masks identify teeth as green and it may be edited using a brush and eraser.
- Make an "images" directory for the images
- Make a "masks" directory for the masks
- Each image should have a corresponding mask with the same filename
- (Recommended) Make a virtual environment
pip install -r requirements.txt
python3 app.py
- Visit
http://localhost:5000
- Controls:
- Previous/Next: Save edits and move to the previous/next image
- Clear (x): Clear current mask completely
- Tool toggle (brush/sponge): Toggle between drawing and erasing
- Brush size (slider): Adjust the current brush size for both drawing and erasing
- Upon load the img param with dictate the filename of the image + mask to be loaded, if none then load the first image
- Drawing should create full white on the image, which is then applied to the canvas as green channel only. okay to have the client treat the mask image as having an alpha channel
- Clicking next/previous should save the existing (edited) mask as a grayscale image, discarding the alpha. okay to have the client treat the mask image as having an alpha channel but the saved image should be grayscale
- The document canvas should have three layers green overlay, greyscale mask dictating opacity of overlay (black = 100% transparent, white = 255 * MAX_OPACITY), greyscale xray image
- There is a clear button that sets the mask to black (overlay 100% transparent)
- Load page with image/mask pair
- Existing grayscale mask drawn with white -> green, black -> transparent, max 40% opacity
- Drawing on the image creates white paths, shown as green as max opacity
- Erasing on the image creates black paths, shown as full transparency
- Clicking clear sets the whole image to black, shown as full transparency
- Clicking next/previous saves the current mask as a greyscale image, discarding transparency
- Image saves as a jpg with 98% quality
- Canvases are reset
- Next/previous image/mask pair shown (start over)
- The mask no longer darkens the image. Instead, it applies a green overlay with varying opacity.
- Drawing on the mask is now in grayscale, with the green overlay being generated from this grayscale mask.
- Saving masks should maintain white -> white, black -> black for unedited portions of the mask