It is currently 24 Feb 2018, 02:17

GIMP Python Fu ScriptsReplace Colors Using Template Script for GIMP (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
Post Reply
User avatar

View: Showcase | Slideshow
Topic Posts: 1/1
Posts: 2191
Joined: 26 Sep 2016, 00:16
Cash on hand: 8,236.90 GLP
Bank: 53,924.25 GLP
Gender: Guy
Location: Victoria, BC
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1218
x 264

Replace Colors Using Template Script for GIMP

Post#1 by tim » 07 Oct 2017, 20:26

This script was created to aid with this question: Change Entire Palette to lessen workload on reddit
Problem: you have an image (to be changed) and a template defining the colors (you want to change to).

:download: #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(1.93 KiB) Downloaded 22 times
Script Menu Location: Python-Fu/Replace colors using template

1. Have your image that you'd like to change palette of.
2. Then add a layer that contains your template (this layer must be renamed to "template") that contains colors you'd like to change to.
3. Image must be in RGB mode.
4. All layers must be the same as image size.
5. Select the layer that you'd like to change colors of (layer in step 1).
6. Make a Selection of area of the template that you'd like the script to scan and change colors based on.
7. Run script (Python-fu/Replace colors using template).

Here are sample .xcfs files so that you can see how they're set up before running script (which you can run scripts on).
one.xcf #
(9.89 KiB) Downloaded 11 times
two.xcf #
(9.35 KiB) Downloaded 8 times
three.xcf #
(9.22 KiB) Downloaded 8 times
Here are sample results of what the script generates with above templates:
one_replaced_colors_using_template.png # (698 Bytes) Viewed 238 times (Watermarked | Thumbnail)
two_replaced_colors_using_template.png # (700 Bytes) Viewed 238 times (Watermarked | Thumbnail)
three_replaced_colors_using_template.png # (687 Bytes) Viewed 238 times (Watermarked | Thumbnail)
0 x

aka Tin

Registered members enjoy ads-free content
Post Reply

Last 20 Members Who Visited This Topic

User avatar tim (27), User avatar gnerd (3), User avatar Pat625 (3), User avatar Issabella (2), User avatar RJKD (1)

  • Similar Topics
    Last post
• Featuring Members' Works (Image Attachments Only) •
3: Wallace
4: Pat625
5: oldmangrumpy
6: Issabella

Who is online

Users browsing this forum: No registered users and 1 guest