Posts: 3
Threads: 1
Joined: Aug 2020
Reputation:
0
Operating system(s):
- Windows (Vista and later)
Gimp version: 3.0
08-07-2020, 02:00 PM
(This post was last modified: 08-07-2020, 02:28 PM by EagleEye559.)
Hey everyone,
I'm working on an image up-scaling project, with a massive amount of texture files; however, I've ran into an issue where the placeholder colors on the texture palette cause interference with the up-scaling software.
Placeholder colors, and the effect they have can be seen here:
https://gyazo.com/d087759e04450d144e14c757cb773d95
I am not as knowledgeable about GIMP's more advanced features, but I'd want to develop a process to batch process a folder of images, and replace the impacting colors with another to resolve the issue.
How would I go about this process? Explain like I am five / don't know anything about GIMP's functionality. Any help would be greatly appreciated!
EDIT: I've started using Color to Alpha, which seems to work for this purpose. Just applying this as a Batch to the whole set is now the challenge.
Posts: 7,177
Threads: 155
Joined: Oct 2016
Reputation:
1,008
Operating system(s):
Gimp version: 2.10
08-07-2020, 02:50 PM
(This post was last modified: 08-07-2020, 02:57 PM by rich2005.
Edit Reason: edit
)
(08-07-2020, 02:00 PM)EagleEye559 Wrote: ..snip...
EDIT: I've started using Color to Alpha, which seems to work for this purpose. Just applying this as a Batch to the whole set is now the challenge.
Without delving into the mysteries of Gimp scripting for a starter you could try the batch plugin BIMP https://alessandrofrancesconi.it/projects/bimp/
Choose other Gimp procedure, search for colortoalpha, and set the colour.
...but it is a bit of a blunt tool. It will remove the colour from everything.
If that works you can add a scaling procedure. Otherwise hopefully more suggestions.
Posts: 3
Threads: 1
Joined: Aug 2020
Reputation:
0
Operating system(s):
- Windows (Vista and later)
Gimp version: 3.0
08-07-2020, 02:57 PM
(This post was last modified: 08-07-2020, 03:09 PM by EagleEye559.
Edit Reason: Image added
)
Thanks for the advice, I've done some quick testing with that method, and I seem to have made an error, as all the files now have a green tint applied. I'll change the approach slightly, but this appears to be a method to pursue for now.
Regardless of the color being converted to Alpha, the rest of the image has it's color shifted.
https://gyazo.com/281090f29317dc15090582304b4bd3d1
Posts: 7,177
Threads: 155
Joined: Oct 2016
Reputation:
1,008
Operating system(s):
Gimp version: 2.10
That is what I meant about C2A being a blunt tool.
Example: An image with a mixture of red-green-blue (as most images are)
Remove one element - in this case a primary - blue and the remaining red and green combine and you also get semi-transparency.
You need some other method
You need to give more information.
What are these 'placeholder colours'?
You mentioned a texture palette, what is that ?
Best if you upload a couple of typical images, maybe zipped into a file on dropbox or similar.
Posts: 3
Threads: 1
Joined: Aug 2020
Reputation:
0
Operating system(s):
- Windows (Vista and later)
Gimp version: 3.0
08-07-2020, 04:12 PM
(This post was last modified: 08-07-2020, 04:13 PM by EagleEye559.)
(08-07-2020, 03:47 PM)rich2005 Wrote: That is what I meant about C2A being a blunt tool.
Example: An image with a mixture of red-green-blue (as most images are)
Remove one element - in this case a primary - blue and the remaining red and green combine and you also get semi-transparency.
You need some other method
You need to give more information.
What are these 'placeholder colours'?
You mentioned a texture palette, what is that ?
Best if you upload a couple of typical images, maybe zipped into a file on dropbox or similar.
You can see an example of the textures here:
https://easyupload.io/xc5um7
As each model or surface references an image, not all sectors in the image are used. Anything not used, will feature a void of color. Some of these colors directly interfere with up-scaling tools, as they border the texture. The affected outcome, is a green tint.
Removing any variants of red from these placeholder voids, resolves the issues during the process.
Posts: 7,177
Threads: 155
Joined: Oct 2016
Reputation:
1,008
Operating system(s):
Gimp version: 2.10
08-07-2020, 06:02 PM
(This post was last modified: 08-07-2020, 06:03 PM by rich2005.)
I do not have a solution, but can I restate (as I see it) the question.
Lots of individual png images, with transparency.
Some with solid blocks of a colour (red?) to remove.
Blocks of this colour, different sizes, different locations.
Keep anything else that has a red component 'as-is'
Obviously one-at-a-time with fuzzy select works.
Needs a script that can search for those individual blocks.
Posts: 6,399
Threads: 279
Joined: Oct 2016
Reputation:
566
Operating system(s):
Gimp version: 3.00RC1
(08-07-2020, 06:02 PM)rich2005 Wrote: I do not have a solution, but can I restate (as I see it) the question.
Lots of individual png images, with transparency.
Some with solid blocks of a colour (red?) to remove.
Blocks of this colour, different sizes, different locations.
Keep anything else that has a red component 'as-is'
Obviously one-at-a-time with fuzzy select works.
Needs a script that can search for those individual blocks.
Assuming the placeholder color has been picked because it doesn't occur anywhere in the textures, a color selection with a very low threshold would select all the blocks. It is also possible to select only on hue.
Posts: 7,177
Threads: 155
Joined: Oct 2016
Reputation:
1,008
Operating system(s):
Gimp version: 2.10
08-08-2020, 02:13 PM
(This post was last modified: 08-08-2020, 02:20 PM by rich2005.
Edit Reason: edit
)
Quote: Assuming the placeholder color has been picked because it doesn't occur anywhere in the textures, a color selection with a very low threshold would select all the blocks. It is also possible to select only on hue.
I do not know. The 'red' placeholder is RGB 240,40,48 and some of the image elements do contain a fair proportion of red.
Individually, not a problem, For batch, the best I get is with the gmic plugin http://www.gmic.eu using a gmic command in BIMP
Code:
fx_select_color 0,0,0,0,240,40,48,255,2,255,255,255,0,0,50,50
Maybe not 100% , you can see from the insets. Big block removed but tiny block remains (edit: ah just checked, different red)
Tried through the 55 images provided. No earth shattering records broken. Took about 45 seconds. (from the first post, "massive amount of texture files" I wonder how massive is massive)
|