-
Notifications
You must be signed in to change notification settings - Fork 41
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
New feature: Export images #332
base: main
Are you sure you want to change the base?
Conversation
Still missing: - color space handling - JPEG XL (different PR) - crop editor (different PR)
Code refactor to respect mostly a width of 80
I appreciate your work, but I think this might be outside the scope of the program. TagGUI is designed for creating and editing text captions for images without modifying the images themselves. I think the features you are implementing are better suited for a dedicated program for processing the images. By the way, TagGUI already supports moving or copying images to a different directory, but these actions do not alter the images. |
This PR is the base for the next two steps I want to include as well:
All of this is the next step in the workflow of starting with a bunch of images and finally coming up with a ready set of training images. So far I know of no other tool that can do this, I know people who are missing a tool for this (not only me :)), it is closely related to tagging the images and taggui is the perfect base for this extended functionality. And all of this is in the (highly appreciated!) spirit of not modifying the source images. That's even the reason for creating the exporting function as it allows you to reuse your valuable data set for new models when they become available: |
Hint about HDR, the Open Model Initiative seems to look actively at supporting HDR images: https://github.com/Open-Model-Initiative/HDR_SDXL |
Advantages are smaller file sizes when compression is acceptable (quality < 100) or lossless compression with quality = 100. Also the alpha channel is supported and kept in the images. Note 1: this only adds support for the export function, and is not general JPEG XL support for taggui. There is the fork https://github.com/yggdrasil75/taggui that does exactly this. Note 2: You might need `pip install pillow-jxl-plugin` beforehand to be able to export into JPEG XL.
@yggdrasil75 I've seen that you are working on real JPEG XL support. Do you intend to make a pull request out of it soon, as it would work very well with my latest commit to this PR (-> #337 )? |
I will once I stop being lazy and actually have it working. might be tomorrow now that someone else mentioned it. |
made the jxl pr. btw, the biggest benefit I would see with this would be adding segm/bbox support to auto mask non-character portions, or auto crop to character, is that the eventual plan? |
That's exactly where I'm heading at. |
Also refactor the code a bit to be able to use the target size calculation more easily in (future) other modules as well.
Now I've also added a few more refinements, so I will not change this branch / RP anymore (unless someone finds bugs that need fixing, of course). So please pull it, as well as #335, as both form the basis. |
This PR adds the ability to export the images to a new folder. During this export the images can be resized to suit the target model size and cropped to fit into the target buckets. After the resize a slight sharpening is happening as it is recommended by graphic specialists.
Notable features:
Additionally code changes:
DEFAULT_SETTINGS
mechanism was simplified to reduce the necessary coding to prevent inconsistency bugs and improve readability