Jump to content
You must now use your email address to sign in [click for more info] ×

Convert photo to specific indexed palette?


Recommended Posts

For a PNG export, look at the More... dialog, and try something like this:
image.png.ee1046aa69a4834f678cbeb0546270f8.png 

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

  • 4 years later...

I'm also looking for this info. The above answer is not sufficient because it's not a specific indexed palette (it's "automatic", ie outside of your specific control).

Here it's described how to save a palette from an image document, but you can't use that palette to convert a document to it?

Link to comment
Share on other sites

12 minutes ago, eobet said:

but you can't use that palette to convert a document to it?

Correct, as far as I can see.

Though you can specify Custom in the Export dialog, there does not seem to be any way of choosing a specific palette in that case.

This is logged as a bug: https://forum.affinity.serif.com/index.php?/search/&tags=AFD-2432

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 hour ago, eobet said:

I'm also looking for this info. The above answer is not sufficient because it's not a specific indexed palette (it's "automatic", ie outside of your specific control).

Here it's described how to save a palette from an image document, but you can't use that palette to convert a document to it?

If I understand your issue correctly, here is a way to create your own palette with the colours you want, rather than the automatic ones created when using Create Palette from Image. It is definitely fiddly, but it works.

1.  From the Swatches panel, hamburger menu, choose Create Palette from Image.  Then import your image document that has the colours you want.
2. When the image appears on your canvas, move the slider to choose 3 colours only.  Choose Application palette, because you must be able to find it in the Swatches panel to use for the next document when you reach step 5.
3. Give the new palette a name. Then in the Swatches panel, right click on any two of the colors that have been automatically inserted, and select Delete, leaving just one colour which you can later delete.
4. Now you close the document
5. Create a blank new document. Choose FILE>PLACE and import the same image document you used in step 1. Duplicate it, and lock the background layer.
Now, with the duplicate layer selected, use the eyedropper from the Swatches Panel, select a colour in the image that you wish to keep, click on the well in the swatches panel, and it will load. Then click to add it to the swatches.  (Video attached.)
6. I did not do this in the video, but once you have one or two of your own swatches placed in your category, you can click on the initial swatch that was automatically selected and delete it.
7. Note that each time you add a swatch to your category, the duplicate layer will remain that colour. That is why you must keep deleting the duplicate layer and then creating a new duplicate.

 

Said it was fiddly! 

 

 

 


24" iMAC Apple M1 chip, 8-core CPU, 8-core GPU, 16 GB unified memory, 1 TB SSD storage, Ventura 13.6.  Photo, Publisher, Designer 1.10.5, and 2.3.
MacBook Pro 13" 2020, Apple M1 chip, 16GB unified memory, 256GB  SSD storage
,  Ventura 13.6.   Publisher, Photo, Designer 1.10.5, and 2.1.1.  
 iPad Pro 12.9 2020 (4th Gen. IOS 16.6.1); Apple pencil.  
Wired and bluetooth mice and keyboards.9_9

Link to comment
Share on other sites

That creates a palette of colors from the image, @jmwellborn, but how do you use it when exporting a Palletized PNG? The Export is the question here, I think.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

@walt.farrell I began by saying “If I understand your issue correctly…”. Apparently not. Oh well. Maybe it will give somebody else a laugh as well.🤪


24" iMAC Apple M1 chip, 8-core CPU, 8-core GPU, 16 GB unified memory, 1 TB SSD storage, Ventura 13.6.  Photo, Publisher, Designer 1.10.5, and 2.3.
MacBook Pro 13" 2020, Apple M1 chip, 16GB unified memory, 256GB  SSD storage
,  Ventura 13.6.   Publisher, Photo, Designer 1.10.5, and 2.1.1.  
 iPad Pro 12.9 2020 (4th Gen. IOS 16.6.1); Apple pencil.  
Wired and bluetooth mice and keyboards.9_9

Link to comment
Share on other sites

20 hours ago, walt.farrell said:

Though you can specify Custom in the Export dialog, there does not seem to be any way of choosing a specific palette in that case.

I think Custom may have provided the ability to use a custom set/palette of colours but as you say that has a bug and has never worked.

 

@everyone

Could this somehow be done using a gradient map adjustment using sharp transitions (i.e. no gradients) between say, 4 custom colours as shown in example below? It sounds like it should work but the results look odd (in some places) even though the colours do appear to be restricted to the 4 chosen colours

(Original image on the left, 4 colour image on the right)

screen99.png

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

  • 2 weeks later...

This topic has been discussed multiple times on the forum, to some depth e.g. here:

For Windows users, it is probably easiest to use G'Mic plug-in and Photo. GIMP itself can be used for this, too (both to produce palettes and reduce colors with palettes).

If Affinity app alone is wished to be used, then using Gradient Map, Posterize (with exact number of colors specified) and Black and White  adjustments in this specific order can produce something similar (with exact number of colors and no shades in between). An alternative is using LUTs.

The result of course is not an indexed image because they are not supported in Affinity apps but the effect is similar.

Searching the forum using e.g. the following keywords should result in some hits: indexed, palette, palettized, color reduction, quantization, posterization, colorization

 

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.

Guest
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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | 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.