Gpt-image-2 image creator and editor app - Python, desktop UI (message #13)
Transparency creation tool included
OpenAI doesn’t deliver transparency as an API feature on gpt-image-2 (while ChatGPT, instead, is delivering transparency by request). If OpenAI changes their mind, I left in the UI option to send transparent background parameter (which is denied currently).
I’ve added transparency creation in the application, though. This can be used to post-process both generated images and files that you load.
Example prompt:
The image shall have a transparent background outside of the subject, easily removed: the background area for transparency is a pure white chroma-key, with this brilliant white background for keying and cutting out and making transparency being sharp, pixel-perfect, without any blending or fading. Avoid pure whites and specular highlights in the main image content.
You can also prompt for black or a green-screen, depending on the subject and the quality of the model’s sharp cutoff.
Example application use:
Defaults are already configured for good performance
Removing lighter-than or darker-than is automatically switched depending on the value of your key color. The status bar will show the image’s color value you mouse-hover over, as (253, 251, 250) of max 255. Then pick it to preview the effect.
Color removal to transparency
Select color key with mouse color picker, and refine cutout with fuzziness control
Smoothing - Alpha channel blending
If you are using a 32 bit color delivery format file when you save (i.e. the default PNG the app saves), instead of a sharp threshold where pixels are either original or transparent, you can have a color-blending alpha transparency, where the edges fade out. Tune this by increasing the smoothing control.
This will appear best if your image has a background key color that is also the expected page color you’ll show it on, or where the contents have a natural feathering to them, otherwise your image might have a color halo.
Discussion in the ATmosphere