It is currently 04 Mar 2021, 12:55

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Palette from Tile Grid Plug-in

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger

Palette from Tile Grid Plug-in

Post#1 by tim » 18 May 2019, 18:19


This plug-in spawned from this topic: http://gimpchat.com/viewtopic.php?f=12& ... 10#p239579
It simply samples a tile grid and creates palette out of it.
palette_from_tile_grid.py #
(3.23 KiB) Downloaded 175 times
Plug-in Menu Location: Python-Fu/Palette From Tile Grid...
palette-from-tile-grid-options.png
palette-from-tile-grid-options.png # (32.55 KiB) Viewed 5374 times (Thumbnail | Recognize)
Instructions:
  1. Have your image opened with your tile grid of colors
  2. Run plug-in. Enter new palette's name, select xtiles/ytiles, then OK to run.
  3. That's it. A new palette will be created under that new palette name.
Sample result input and resulting palette:
yellow-tile-grid.png
yellow-tile-grid.png # (39.8 KiB) Viewed 5374 times (Thumbnail | Recognize)
yellow-palette-from-tile-grid.png
yellow-palette-from-tile-grid.png # (11.89 KiB) Viewed 5374 times (Thumbnail | Recognize)
aka Tin

         

Wallace
Global Moderator

Post#2 by Wallace » 18 May 2019, 18:58


:thats_awesome:
Image

Pat625
Tutorial Creator

Post#3 by Pat625 » 18 May 2019, 21:34


That is awesome, as Wallace states. I do not know how you can do it so quickly!

tim
GL Blogger

Post#4 by tim » 18 May 2019, 22:06


It was simple in logics.
pseudo code:

Code: Select all

Loop through y-tiles
   Loop through x-tiles
     Sample the color a center of tile.
     Add it to palette.
That's it.
aka Tin

         

Alchemist
Forum Member

Post#5 by Alchemist » 18 May 2019, 23:26


Hello Tim,

WOW, another great plugin. This will be used well.

Thanks.....
GIMP Learn rocks...

nidhogg
Forum Member

Post#6 by nidhogg » 19 May 2019, 08:49


That's a brilliant idea, seems to pick the colors perfectly from any tiled image. Thanks Tim.
GIMP Learn rocks...

neurolurker
Forum Member

Post#7 by neurolurker » 19 May 2019, 11:36


Thanks always to Tim. :gimp_clap:

If you do hunter-gathering on web palettes, you find most of the images you might want to use as GIMP color resources are not indexed and are not organized in grids and making palettes from them can be tedious. With Tim's script you can sample gradient images with alarming ease:
tt gradient PLT GSFS 000277.png
tt gradient PLT GSFS 000277.png # (58.58 KiB) Viewed 5304 times (Thumbnail | Recognize)

This works well with, for example, color temperature gradients and hue-based gradients. Similar colors can simply be deleted with the PALETTE EDITOR. Or, as in the whites above, retained for their visual framing value.

If the source image is organized but has text it can be pre-processed in a few strokes and clicks. Text (such as color names or RGB values) placed over the individual colors can be cleared up with the clone tool or Resynth HEAL SELECTION or select-and-delete followed by ZEALOUS CROP to close the gaps.
Centered text.jpg
Centered text.jpg # (22.93 KiB) Viewed 5304 times (Thumbnail | Recognize)
Centered text after FILTERS - MAP - RESYNTH - HEAL SELECTIONs.jpg
Centered text after FILTERS - MAP - RESYNTH - HEAL SELECTIONs.jpg # (11.34 KiB) Viewed 5304 times (Thumbnail | Recognize)
If there's any further development interest in the script, in my opinion it would be useful to have a variable sample area to use for source images less well organized than gradients. Such as paintings or photos. Some [well, at least one] "natural media" painting programs offer this feature as part of their [its] palette-making.

And, for myself, to close the circle, it would be nice to have the current output also export into a new image. Perhaps as a grid instead of HTML. There already may be a script or function to do this directly, but I haven't found it yet. Still new at GIMP and still hunting.
GIMP Learn rocks...

tim
GL Blogger

Post#8 by tim » 19 May 2019, 13:55


For exporting to html table try: viewtopic.php?f=3&t=1643&p=19134
aka Tin

         

neurolurker
Forum Member

Post#9 by neurolurker » 19 May 2019, 14:43


Tim, I've got the plugin (version two but I've tried both recently) but it doesn't show up in the list with the other export choices. I have it in the personal plugins folder but have also tried it in other locations, including the SHARE folder but still couldn't find it. Always possible I've missed something glaringly obvious, but can you offer any guidance? Thanks.
GIMP Learn rocks...

tim
GL Blogger

Post#10 by tim » 19 May 2019, 14:49


Please try version 3 (changed to UTF-8 instead of UTF-8 BOM for WIndows).
aka Tin

         


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 14 guests