Friday, June 12, 2020

How To Create Photo-Realistic Chainmaille Inlay Patterns

Let’s learn how to design photo-realistic chainmaille inlays like a pro!

This is the method I use for photos but it’s definitely not the only way. Hopefully you find this helpful, all the same.

Also, this is specifically for photo-based inlay patterns. Lower detail inlays and sprites are their own animal, worthy of their own tutorial. Photos may require some lighting and color correction up front, but low-detail inlays often need a lot of pixel-by-pixel cleanup and smoothing at the end. I’ll try to put one together someday.




0. Find A Good Picture

Colorful and dynamic helps. Subtle shadows tend to become dark voids. Keep in mind, the more detailed your base image, the more outrageously large your inlay will need to be to keep that detail.

So, without further ado, I’ve found the perfect muse, and HIS NAME IS JOHN CENA! /Trumpets 


First things first, convert your starting image to PNG or something else small and lossless. Saving as a JPG later on will screw up your perfectly indexed colors and will probably crash IGP. I also recommend saving each action/step as a different file. This method is destructive and we’re going to create a lot of variations until we find something that works.




1. Tools You’ll Need

Install GIMP - https://www.gimp.org/
It’s a free, open-source photo editor that is thankfully still well supported. Other programs like Paint.net, Photoshop or Affinity Photo work too, but the terminology and tools may be different.

Download IGP (Irregular Grid Painter) - http://www.zlosk.com/pgmg/igp/
There are other chainmaille inlay tools out there, but I’ve never used them. It’s a little clunky but it gets the job done.



2. GIMP – Setting Up Your Palette

In GIMP, go to [Windows > Dockable Dialogs > Palettes] to open the Palettes dialog.
Create a new palette and double click to open it.


Inside your new palette:
[] Add columns to make it easier to see.
[+] Add a ton of generic color swatches.
[] Define the colors by double clicking each tile and changing the "HTML notation" field to the below list of  hex codes, one by one. The palette should save automatically as you make changes.


E9AECA / Pink
D95B8D / Rose
AA2A2A / Red
CC790E / Rose
EBE9A0 / Pale Yellow
F0EA00 /Yellow
88BA1F / Lime
376C02 / Green
CAE3D3 / Sea Foam
7CC2D3 / Sky Blue
2159BA / Blue
A9ACDA / Lavender
480AD8 / Purple
8D0AD8 / Violet
1E2020 / Black
6C747B / Black Ice
EBEDED / Bright Silver
D5AC33 / Gold
B0A984 / Champagne
5E452B / Bronze
F1F3F0 / Frost (Matte Bright Silver)

If a color doesn't match the ring colors you have access to, change it or get rid of it. Ex, the 4th color, EBE9A0 / "Pale Yellow", was a temporary color that The Ring Lord carried a few years ago. I keep it in my palette, because I still have a bunch.



3. GIMP - Resizing

If you want to make a pattern out of anything other than sprites or pixel art, you're probably going to want to shrink it down to something manageable. For instance, a 100 x 100 pixel icon equals 10,000 rings. That's a lot of work! However, if you make it smaller, you may lose a lot of detail. You'll have to find your own balance between ring count and detail.

3a. Squashing Your Image
Another thing to consider is that chainmaille patterns don't necessarily have square "pixels". I mostly use AR 4.0 rings (18swg 3/16" or 16swg 1/4"), which act like tall, stretched out, crescent-shaped pixels when woven as European 4-1. Everything here assumes we want to use AR 4.0 rings.
To compensate for the stretch, go to [Image > Scale Image] and resize only the vertical dimension to 75%. Make sure to unlink the horizontal dimension for this part.



Don't worry! It'll stretch out to normal proportions when we make the chainmaille pattern.

3b. Resize your squashed image again.
The squashed image went from 1080x1440 to 1080x1080, which is still way too large. If you were to making a chainmaille inlay of the image as-is, it would take 1,166,400 rings. O_O


Go back to [Image > Scale Image] and shrink both dimensions by %. Pay attention to the previewed dimensions. Multiply them together to get your total ring count. In this case, 108 x 108 pixels equals 11,664 total rings. Try out a bunch of different %s to see how much detail is lost and how many rings it will take. Keep in mind that you'll lose even more detail later when you apply the limited color palette, so don’t go too small.

5% 54x54 = 2,916 rings (~9 hours of weaving at my personal rate)
7% 76x76 = 5,776 rings (18 hours)
10% 108x108 = 11,664 rings (36.5 hours)
15% 162x162 = 26,244 rings (82 hours)



My love for and dedication to John Cena only extends to the end of this tutorial, so I'm going to stick with 10%. If you're his #1 fan and have an irresponsible amount of money and time on your hands, crank it up to 15%!



4. GIMP - Recoloring and Indexing Colors

In GIMP, go to [Image > Mode > Indexed] to pull up the Indexed Colors dialog.


Select your custom palette from the list, select one of the available “Dithering” algorithms and click “Convert”. GIMP will then try it’s best to give the impression of the old colors when seen from a distance by grouping unlike colors together. Some algorithms are better in certain situations. See below. Up close, they all look like hot garbage.



Dang. Looks like a Warhol painting.

For this kind of application, the two Floyd algorithms are best. Normal and Position really shine when working with less-detailed or posterized photos. See below. For what it’s worth, Floyd still looks great. However, from my experience with weaving inlays, the random noise present in Floyd makes the instructions VERY hard to read. Position is noisy, but at least it’s consistent.



There are many other dithering algorithms out there and not every program’s version outputs the same result. If you want to make tons of inlays, it’s worth researching.



5. Irregular Grid Painter (IGP)

Finally the chainmaille part! IGP turns images into a chainmaille patterns, but be careful with the file formats and sizes you use. It’s a fragile program and tends to crash if it feels overwhelmed.

In IGP, go to [File > Open] and open your indexed image of choice.
Go to [Patterns > Maille > European > 4-1: 4.4AR - ... - Right Way] to set the chainmaille pattern I use for 18swg 3/16” inlays. The rings are realistically bunched together, like it’s hanging. But, play around with the other options. You can always switch back.


Finally, go to [File > Save Patterned Picture] and save as a PNG.


That looks a lot better than I expected...

If anything looks off, you can tweak individual pixels in Paint. Just make sure to only use existing colors from the indexed color palette. You can technically paint in IGP, but it doesn't let you eye-drop the colors in the image. Any new variations in colors will screw up this next part.



6. IGP - Pattern Instructions

In IGP, click "Count Colors". This will display a slightly cramped list and count of every color used in the image.


Double-click each RGB code and rename them however you like. I recommend shorthand codes, like SF for "Seafoam" or GD for "Gold".


After you're done renaming all of the colors, click "Save as text..." in the ColorCount dialog to save the pattern as a raw, line-by-line text file.

Open the text file.

If everything went smoothly, you should have a shopping list of rings you’ll need and a GIANT list of rows for the pattern. In the example below, Row 1 starts with "1: SF-1 CH-1 GD-1 PY-1...", which means 1x Sea Foam (SF) ring, followed by 1x Champagne, 1x Gold and 1x Pale Yellow ring, etc. Every row has 108 rings and there are 108 rows.


It’s VERY easy to lose your place, so I recommend reformatting and printing the entire text file so you can cross out completed areas as you go. Also, remember to reference the full-sized patterned image on your computer to make sure the rows you’re working on line up vertically. Speaking from experience, it really sucks to realize you accidentally offset a couple of rows by one pixel an hour ago and you have to take it all apart and try again.



7. Final Thoughts

For funsies and because I think they’re worthwhile to learn from, I produced the full patterned images for the % and B/W dithered images.


I mentioned earlier that recoloring pulls out another layer of detail. Case in point. 7% looks more like Corey Taylor than John Cena and 5% looks like Odo. All were done with Floyd (Reduced Bleed). If I was doing the 10% version for real, I would go back to the original image and lighten up the face (Dodge tool on a very low opacity) to soften some of the harsher shadows and lighten up his skin and shirt a little bit.


If you want to go the posterized/outline route, none of the algorithms are truly awful. But if I were doing it for real, I would want to manually piece together a hybrid image using the background from Normal, the highlights of Floyd and the shadows from Position (with some manual tweaks).


Updates:
200613 - Step 6 simplified. I didn't know you could double-click and rename the RGB color codes directly in IGP. Always learning!

2 comments: