Saturday, February 08, 2025

Techniques of wallpaper generation

 kw: instruction, ai art, upscaling, wallpaper, screen shows

Introduction

I am a collector. One type of collection is sets of images that make good screen wallpaper. My folders of screen wallpaper images includes masses of flowers, mineral crystals (particularly in masses), selections from Hubble and JWST astrophotographs, waterfall photos, and landscape paintings. Now that I've been experimenting with art generation using various SI (Simulated Intelligence) programs, I have a growing body of work in several genres.

My computer setup has two screens with resolutions of 1920x1080, or standard HD. Anticipating that sometime in the future I may transition to one or two 4K screens (3840x2160 or UHD), when I encounter an image that size or larger I don't reduce its size, but keep it for the future. However, I usually reshape an image by cropping it to a 16:9 aspect ratio. I use the "screen saver" program gPhotoshow to cycle through one or more folders of images I want to display during idle time.

This post is in two parts. Firstly I discuss the production of an image of appropriate size and aspect ratio, beginning with the seven image sizes produced by the five programs I have been using. Secondly I explain how I sign an image to give credit to myself and the program that I used, especially matching the signature size with the image size.

Image Sizes and How to Treat Them

This is a reduced version of an image I produced in my "Troglodyte" series. A troglodyte is a cave dweller. I call my basement library-and-computer-room my Man Cave, though most men who have such a space use it for watching sports. I decided to play with the idea of having an office in a real cave. Eventually I produced more than ten rooms, as though I owned a cave large enough to convert into a sort of mansion, which was dry enough that my furnishings would not mildew.

I was also experimenting with lengthy prompts for this project, but that is less critical just now. I used Leonardo AI, with the style Leonardo Lightning and substyle Creative, and Aspect Ratio set to 16:9, to produce images sized 1368x768 pixels. It didn't take long to find that the ratio was off a bit: 57:32. What's going on?

All art generating programs produce images that are made up of square blocks. In this case, the blocks are 24x24. There are a few ways to get 16:9, or 1.77777…, from 57:32, or 1.78125. However, I am a purist, so I want the vertical dimension to be a multiple of 9, and better yet, I decided to restrict images to multiples of 18 pixels high, and thus, also having horizontal dimension the same multiple of 32.

Considerations Regarding File Locations and Naming

Whatever program I use, when I download the image, it is put in the Downloads folder. Thereafter I do any work on the file, which may be several steps through intermediate files, in the Downloads area. Sometimes I use folders under Downloads to keep things organized.

Whichever program I use, right after I download it I rename the file. I have two ways depending on the length of the prompt.

Short Prompts (less than ~120 characters)

From a recent project: 

IFX 250203-08 Two naturalists and two medium-sized dinosaurs sitting together at a table having tea and croissants, digital art

This image was produced by ImageFX on the date shown (a few days ago), and is the 8th image I made that day using ImageFX. This prompt is 113 characters, a bit longer than usual, but it doesn't make the file name overflow the namespace in the disk's file system.

Long Prompts

I keep a file of long prompts, dated and labeled. The image above has the file name Leo 241108-03 LLightning Creative Prompt 241108-02, Cave Office

This was produced by Leonardo AI using Leonardo Lightning style and Creative substyle; the rest of the file name identifies the prompt.

If I have just one or two files I'm working on, I do so individually. Otherwise I use batch mode.

Convert Files as Needed

All but one of the programs I use produces files that are smaller than 1920x1080. Gemini produces only square images 2048x2048. I'll show how to deal with that later. For all the others I use Upscayl to make the image larger and sharpen it.

One caveat with Upscayl: although it will make a valiant effort with a PNG image, the resulting image is monochrome (gray), so I first convert PNG files to JPG, for which I use IrfanView, also in batch mode if I have more than two images. Furthermore, image files produced by ImageFX have a JPG extension, but they are PNG files. I open them one at a time using IrfanView (it can quickly skip from file to file, so this isn't too time consuming). Before opening a file it asks if I want the extension corrected. I click "Yes" and continue. Then you are ready to convert these to JPG.

DreamStudio also produces PNG files. They need to be converted. The following image shows the IrfanView batch edit screen:


Here are the steps:

  • Select Batch Conversion at top left
  • Select JPG as the output format
  • Select the output folder at middle left (I already made a folder named OutPix under Downloads). Next column:
  • Select the input folder at top right (I already put all the files to be converted into a folder named PNGPix under Downloads).
  • Select PNG as the input format (file type).
  • Highlight all the files and click "Add".
  • Click Start Batch at lower left.

This will convert the files and put them in the folder OutPix, ready for upscaling.

Upscaling

For upscaling an image by 2x, 3x, or 4x I use Upscayl. It has several upscaling models. I usually use FAST REAL-ESRGAN, which takes about ten seconds to convert a ~1K image on my computer. When I want ultimate quality from a highly detailed image, I use REMACRI, which takes about two minutes per image. Upscayl has a batch mode, which works on a folder at a time. 

This is the screen that appears when you set Upscayl to batch mode:


Here are the steps:

  • Step 1, I put the files to upscale into a folder called OutPix that is in the Downloads folder, as noted above. This would include files from programs that produced JPG natively.
  • Step 2, select the model and ratio (2X in this case)
  • Step 3, I choose the Downloads folder. I work in the Downloads folder because files there don't get backed up to OneDrive. That lets me work and then clean up, followed by putting the files I plan to keep in their final folder(s) later.
  • Step 4, click Upscayl to start the process. 

For the 14 files shown, this model ran a little more than two minutes. Had I used REMACRI, I could go get a snack: it would take half an hour.

Image Sizes in Each Program

IrfanView has a wonderful item in its Edit menu: "Create maximized selection (ratio:)" with a caret off to the right. Click that to see available ratios. You can add any ratio you like by using the prior Edit menu item: "Create custom selection...". 

If you have an image, for example, 1920x1200, that you want to crop to 1920x1080 (and there is headroom or footroom to do so), you can click this option, then the caret, then the 16:9 item, and cut lines will appear. You can use the up or down arrows on the keyboard to slide the selection, then CTRL/Y to crop the image. Save with a new name.

Dall-E3

1024x1024 → 1792x1024 (1.75:1=7:4). You initially get four square images. Click an image to work with it. There is a button "Resize" with a "4:3" option. It actually produces an image close to 16:9 but not quite. The image is similar to the square one, but not the same, and it can be quite different.

Process: Upscale by 2X to 3584x2048, then crop to 3584x2016.

DreamStudio

There are two Stable Diffusion models. In either case, there is a setting to modify the pixel count. Only DreamStudio can do this at present.

  • Stable Diffusion v1.6 with 16:9 selected sets the size to 910x512 (1.7773:1=455:256); reset to 896x504, which is (16x9) times 56. Then upscale 3x to 2688x1512.
  • Stable Diffusion XL v1.0 with 16:9 selected sets the size to 1344x768 (1.75:1=7:4); reset to 1344x756, which is (16x9) times 84. Then upscale 2x to 2688x1512.

Gemini

2048x2048. Negotiate by asking for "wide format" and possibly tinkering with the prompt until there is sufficient headroom and/or footroom to crop to 2048x1152, which is (16x9) times 128. No upscaling is needed.

ImageFX

1408x768 (1.833:1=33:18). Upscale 2x to 2816x1536, and then in IrvanView use the Resize function to get 2805x1530 and (using the Edit subfunction) crop to 2720x1530, which is (16x9) times 170.

Leonardo AI

At least one style mode produces a larger size.

  • Most styles produce 1368x768 (1.78125:1=57:32). Upscale 2x to 2736x1536, resize to 2725x1530, crop to 2720x1530.
  • Leonardo Phoenix produces 1472x832 (1.769:1=23:13). Upscale 2x to 2944x1664, and then crop to 2944x1656, which is (16x9) times 184.

There are some other methods one can use. For example, for a Dall-E3 image that is 1792x1024, you could use the Resize function in IrfanView to produce 1920x1097, and then crop it to 1920x1080. The Resize is only by 7%, so it produces an image with a good appearance. You can also crop out a 1920x1080 image from a Gemini image. A lot depends on the image you are working with.

Signing the Image

Style of Signature that I use

Having several different image sizes, it's a bit tricky to add a signature to an artwork that is of a consistent size. I like to use a signature in two or three parts. The more usual two part signature, using my first two initials plus last name, is like this:

OK Myname / Dall-E3 2025

For an image I produced this year using Dall-E3. I use abbreviations for the others:

  • DreamS = DreamStudio
  • Gem = Gemini
  • IFX = ImageFX
  • Leo = Leonardo AI

Sometimes an image is part of a series, such as the Cave (Troglodyte) series. Then I'll use a 3-part signature on two lines, such as:

OK Myname / Dall-E3 2025
Cave Master Bedroom

I set the second line to a smaller type size, typically about 0.7 of the first line.

Size and Placement

Most images have an area near lower left or lower right where a signature can be placed. I use the Paint dialog (F12 key) and select the "A" for text input. The cursor becomes a little plus that shows where the lower left corner of the first line is to go. Using a signature on the right is harder because it's often hard to tell how long the text is going to be. 

The greatly differing image sizes mean it is best to use corresponding type sizes. After some experimentation, I settled on using this basis: 14 points for an image 1988 pixels wide, which is suitable for images with horizontal dimensions from 1920 to 2194. This grows to 28 points for the range 3840 to 4114. This table shows the sizes I use:


This is a picture because tables are hard to produce in Blogger. The Paint/text tool's list of type sizes is all even numbers, but you can type in an odd number. All I can say is, experiment with it to find out a procedure that you like, or can live with.

Color

I looked at paintings by several artists. Some use a black signature, but many use a color from elsewhere in the painting that contrasts with the area of the signature. I like this method. The Paint tool has plenty of flexibility in this regard.

Font

Many years ago I designed a few fonts for a project. One of these is a strongly-weighted Sans Serif font that I like, so that's what I use. The Paint/text menu lets you select any installed font.

This isn't wholly comprehensive, but I hope it is enough to get you started turning generated art projects into wallpaper for your computer screen(s). Also, whatever art you produce, if it's for the public to see, signing it is a good idea.


No comments: