Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: simple image modification (crop, resize, mask painting) #294

Open
ChristianMayer opened this issue Oct 28, 2024 · 0 comments

Comments

@ChristianMayer
Copy link

General request

It would be great to be able to draw a selection frame in TagGUI which would then crop the image to the selected content and resize it (only shrinking) to then fit a configured maximum size.
And for masked training it would be great when the mask could be drawn in TagGUI as well.

Refinement

It would be great to be able to configure a list of valid aspect ratios or sizes and then the selection frame will automatically be constraint to them. This would be great for batched training and keeping the number of batches small.

Implementation idea

TagGUI doesn't modify the images only the captions. This is great as it prevents you from worrying about modifying precious data!
So I suggest to store the image manipulation data either in a hidden tag or in a side file like my_image_name.jpg.meta. And then TagGUI could offers an export menu entry where then all images are cropped and resized and stored together with their caption file in a new directory.

Additional information

  • Resizing an image should use the best algorithm. Lanczos comes to mind and there should be implementations of it easily available in libraries. After shrinking an image usually you should follow with a slight sharpening (e.g. unsharp mask with 0.5 pixel width).
  • Image mask can come in two kinds, either it's stored in the image itself (when it is stored in png format) or it comes in an additional greyscale image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant