Help with a recolor of a folder of images to a set of hex colors. - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: Help with a recolor of a folder of images to a set of hex colors. (/Thread-Help-with-a-recolor-of-a-folder-of-images-to-a-set-of-hex-colors) |
Help with a recolor of a folder of images to a set of hex colors. - Nmbr5 - 12-12-2021 I am trying to help my son on a project he's working on, a Minecraft mod. but neither of us are artists. what we need to know is if there is a way to batch process a folder of images and recolor them all outputting 118 different images from a set of 118 Hex color codes for each image. hopefully naming each originalfileanmehexcode.png when done if there is a tutorial for something like this out there I would be glad to read and or watch it. Lacking that I would be appreciative of any help anyone here would be willing to give. RE: Help with a recolor of a folder of images to a set of hex colors. - rich2005 - 12-13-2021 Is this N number single colour images, each coloured to another single colour ? That is N x 118 new images. Can you post an example before / after image(s) RE: Help with a recolor of a folder of images to a set of hex colors. - Nmbr5 - 12-21-2021 Sorry this has taken so long to get back to had things come up.here are the sample files requested named as the original post stated. (12-13-2021, 02:49 PM)rich2005 Wrote: Is this N number single colour images, each coloured to another single colour ? That is N x 118 new images. RE: Help with a recolor of a folder of images to a set of hex colors. - rich2005 - 12-21-2021 My two euros worth. For a batch operation Imagemagick (IM) http://www.imagemagick.org is more suited than Gimp. Even so it is not going to be easy and I do not know the best way for a Windows user. Using your examples and IM a single conversion is straight forward, note the "#.." for the colour. Code: magick brick.png -colorspace gray -fill "#4c2c66" -tint 100 brick4c2c66.png Long time since I last used a Windows .bat file (Any Windows user suggestions more than welcome) In linux, for a single file, producing 118 variations would look like this where the file name is passed as variable $1 as: https://i.imgur.com/Svc0d3u.jpg Gets even more complicated extracting just the tile name (without extension) in a further loop. Sorry not a lot of help for you. You could ask on the IM forum https://github.com/ImageMagick/ImageMagick/discussions where one of the moderators is a Windows user. Edit: Just wondering why the brick4c2c66.png filesize is larger than brick.png filesize both are RGB mode, I could not see anything obvious but it did bring up one thing. The IM script makes an indexed image. Identical to RGB version and obviously much smaller. Attached the IM coloured file to compare: RE: Help with a recolor of a folder of images to a set of hex colors. - Nmbr5 - 12-22-2021 I'm very close to what I need in my batch programming. but still need a bit of help if any here can lend a bit of a hand.at this time I need to strip out the original file extension form my %%a variable. Code: echo off ' Wrote:'rich2005My two euros worth. RE: Help with a recolor of a folder of images to a set of hex colors. - rich2005 - 12-22-2021 Parsing the filename is always a pain. I use similar to generate several thousands tiles for picture mosaic creation where the double extension is no problem A quick search, you have probably already seen this for Windows, https://jonlabelle.com/snippets/view/dos/get-file-name-without-extension On a more basic level if you can rename the 118 tiles dropping the .png extension IM will use the 'magick number' to identify the file type so (in linux) brick.png becomes brick = variable $1 and that works here: Code: #!/bin/bash RE: Help with a recolor of a folder of images to a set of hex colors. - Nmbr5 - 12-24-2021 I finally got this working with the help form here. Thanks a bunch Rich2005! In case anyone is interested in the solution here it is. Code: echo off |