Jump to content

Paint by Numbers


Recommended Posts

I am attaching an Affinity Photo macro that turns a photo into a “Paint by Numbers” image. The attached file is a macros category, and should be imported through the “hamburger” menu at the top right of the Library panel. The category can also be imported into the iPad version of Affinity Photo, although there is one important limitation (more on this later).

When you use the macro, it creates a Group called “Paint by Numbers Effect.” All of the changes are inside of this group, so you can turn it on and off simply. Once you look inside the group, you will see multiple layers. From bottom to top, these are:

1) Original Image - Merge Visible

This is a “merge visible” version of your photo. It includes all of the editing you may have done up until that point.

2) Posterization Adjustment

This is a Posterize adjustment layer, and is meant to reduce the number of colors/tones used in the effect.

3) Outlines

This is a separate layer, created (in part) by using a Detect Edges filter. It provides outlines for the areas of color. This mimics the outlines that were present on the Paint by Numbers boards we used as kids.

4) Normalize Colors

This is a copy of the original Merge Visible image, and has its blend mode set to Color. This is used to reset the posterized colors to more natural ones.

5) Adjust Brightness & Contrast

This is a finishing adjustment, and can provide a better final effect.

* * * * * * * * * * * * * * * * * * * *

Once you click the macro, you will be presented with a default version of the effect. A dialog box allows you to set a number of parameters. As you change each of these parameters, the Paint by Numbers effect is updated. You are asked:

Posterize - How Many Colors?

The default value is 4, but values between 3 and 6 generally give good results. If your image is a portrait, judging the final result by looking at what the different values do to the subject’s face is a good idea.

Outlines - Adjust the Opacity

The default is 50%. Adjust this upward to make the outlines more prominent; adjust it downward to make the outlines less obvious. Set to 0 to make them go away entirely.

Finish - Adjust the Brightness

Finish - Adjust the Contrast

The default is 10% brightness, and 20% contrast. Adjust these up or down to give you final effect the desired finish.

When you click Apply, the effect is finalized. Obviously, you can manually change any of the settings after the fact. However, you should know that while the number of posterization levels for the image is non-destructive, the originally chosen number is also used to create the outlines, and this is a destructive change. Although you can change the posterization level after the fact, it is not advisable to do this. The outlines might no longer line up with the individual areas of color.

Also, for some reason, the iPad version of Affinity Photo handles the macro pretty well but will not allow you to change the number of posterization levels before finalizing the effect. It is baked in at 4 levels. You can change this after the fact, but (as above) the number of levels in your posterized image may not match your outlines very well.

Here is the macro in action. The original image is top left; the parameters dialog is shown in its default state, and then changed during the course of the macro; the final effect is shown top right


As always, I am one person with one computer and have not tested this in every possible scenario. Try it and, if you like it, keep it and enjoy it. This forum has provided me with so many good ideas and answers to questions; this macro is my attempt to “pay it forward.”

[Note: Credit where credit is due. I am indebted to Dave Straker, whose recent YouTube video gave me some excellent ideas for this macro. Dave’s channel is called “InAffinity,” and is a steady source of helpful information. Thanks, Dave!]


Paint by Numbers.afmacros

Link to comment
Share on other sites

Interesting, works on iPad too but without a dialogue box. Simple matter to select the individual adjustment layers and change settings though.

Many Thanks 

IPad Pro 10.5/512GB   lpadOS 16.2 Apple Pencil (1st gen), Affinity Photo 1.10.5 Affinity Design 1.10.5 Affinity Publisher 2, Affinity Designer 2, Affinity Photo 2

Official Online iPad Help documents (multi-lingual) here: https://affinity.https://affinity.help/ 


Link to comment
Share on other sites

  • 8 months later...
  • 9 months later...

please i need some help, the files with .macros will not import? usually when it is zip i can extract it,  but how do i change it to the file format  .macro? What program will extract this for windows 7?    i found the answer. 

Edited by Paul Ehrat
i found the answer,
Link to comment
Share on other sites


Do NOT try to change the file extension - it will not work. You can import the macros (as a macro "category") into the Library panel. There are 2 different kinds of macro files - (i) a single macro, exported from the Macro panel; and (ii) a macro category (which can include 1 or multiple macros) exported from the Library panel. The former has a file extension of .afmacro and the latter has an extension of .afmacros . Yes, it is a subtle difference and it confuses a lot of folks; perhaps Serif should have chosen extensions that were more dissimilar.

The bottom line. The Paint by Numbers.afmacros file can be imported from the Library panel.

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

Thanks for this nice little helper. 

AMD Ryzen 7 5700X | INTEL Arc A770 | 32 GB DDR4 3200MHz | Windows 11 Pro (22621.1778)
Affinity Suite V2.1 & Beta
Better translations with: https://www.deepl.com/translator  
SVG preview in Windows Explorer with "SVG-See  Download SVG-See

Impossible things are done immediately, miracles take a bit longer!

Link to comment
Share on other sites

  • 1 year later...

Hi, @EmilyTheG. Welcome to the forum.

It looks to me that your link opens a commercial site that will convert a photo into a physical canvas, pre-printed with outlines and "numbers" corresponding to a set of paints that the purchaser then applies to create a paint-by-numbers canvas. Obviously, the macro I attached is something entirely different.

Although the end result is designed to look similar to an actual Paint by Numbers canvas, this is a software rendition only. I have no idea how the "Custom Paint by Numbers" people get their photos processed and turned into canvases. My way seems like a lot less work, though!

Link to comment
Share on other sites

  • 7 months later...

I can't wait to try it out and turn some of my photos into paint by numbers images. The step-by-step breakdown of the layers and adjustments is incredibly helpful, especially for someone like me who is still learning the ins and outs of photo editing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.