日本語ページ   ▶AI art top   ▶AI art blog   ▶Image top  

🤖🖼 AI Art Blog 🅰🅸 🅰🆁🆃

A blog related to original AI artworks. I make AI artworks using coined words and emoji as prompts.


The Necessity of AI Art Image Corrections and an Automatic Optimization Program for It

2023-05-11 16:00

Many of the AI art images on this site required adjustments to contrast and brightness. Without them, it is sometimes difficult to discern what is depicted in the images. Until now, I have made these adjustments manually, but I have developed a program that automates the optimization process.

For creating AI art images, I use a web site, OpenArt.ai or NightCafe.studio. However, when publishing images on either site, it shares them without any modifications. Unfortunately, many of the AI-generated images, although aesthetically pleasing, appear grayish, and it is hard to discern what they depict. Here are some examples of such images:

05dzAfQ4_1675259801072 ZAeqRU2e_1675258400367

The images generated by Stable Diffusion 1.5 have low contrast, making them visually unappealing and difficult to interpret. (This issue is less common in Stable Diffusion 2.1, which generally produces images with stronger contrast.) I have previously written a blog post titled “Editing AI Images” that covers methods for enhancing low-contrast images. While I will not repeat the details here, adjusting the gamma value is the key to increasing contrast.

Several months ago, I established a method for image corrections. Initially, I am manually editing each image individually, but I realized that manually editing all images would be too time-consuming. Therefore, I developed a program that automatically adjusts the images. Low-contrast images typically do not utilize the full range of pixel values from 0 to 255 (near 0 and 255, specifically). Based on the range used, the number of dark and bright points, and other factors, I determined the gamma value and implemented a transformation where a constant exceeding 1 is multiplied by the pixel values.

This method effectively adjusts the contrast and brightness of the majority of the images. However, some images may still have insufficient or excessive contrast. Additionally, relying solely on automatic editing may result in images that are not sufficiently captivating. Therefore, manual editing is still necessary for cases where automatic optimization falls short. However, by applying this automatic transformation in advance, the editing process has become much easier. Here are the results of processing the images above using this program. In this case, I think the adjustments may be slightly excessive, but it is evident that they were improved.

image_random_05dzAfQ4_1675259801072_raw.jpg image_random_ZAeqRU2e_1675258400367_raw.jpg

There are two reasons why automatic optimization may not always achieve the desired outcome.

The first reason is that the editing process depends on (my) subjective impression of the artwork, which cannot be pre-programmed.

The second reason is that the editing process depends on the prompts given. For example, when using a prompt like “nigh” to create a nighttime scene, it may be necessary to manually darken a bright image. Since I do not intend to incorporate English language knowledge into the program, this adjustment needs to be made later.

Although the program minimizes loss of image information, when performing manual edits, it is possible to significantly increase the brightness, even eliminating the contrast within the bright areas (setting the pixel values to 255). However, I typically exercise caution to avoid excessive editing. For example, I ensure that the range of pixel values does not solely consist of 255.


Dasyn.com デイシン
Created: 2023-05-11 16:00   Edited: 2024-03-26