Duplicating Colors Using Texture Nodes

Hello everyone, I’ve been wanting to use the Texture Nodes in blender render for a variety of reasons, but I can’t figure out how to match colors from Blender to colors produced from other applications (Photoshop and Gimp). The two attached images show what I’m trying to do (match the created dirt image color from gimp inside of Blender). But as you will see, they look nothing alike even when using the same base color, so really, I have 2 questions:

  1. Is my node setup wrong for producing the result I am after (a simple 1 color overlay that matches the original image).

  2. How do colors work in Blender - Obviously entering in colors from photo editors won’t work since blender is using a percentage and not a straight number. But I’ve tried entering in the correct fraction of a color, but it still ends up wrong in blender, and changing the Value to get the right color destroys the rendered image. I’ve only had success entering the html value to get the same color, but doing that defeats the purpose of using blender.

Any insight is appreciated.




Have you tried getting the hex value of the color in the paint program, copying it, and then pasting it in the hex entry of Blender’s color picker?

The hex value is what I always use when copying color from one program to another. It works with PS to Blender.

try inverting the sockets around on the colormix (overlay)… the first input is the base, the second input would be the changer…

@ doublebishop - tried inverting it, turns the image grey (grey hue, not flat grey)

@jblender and ace dragon- I have used the hex color to get the exact color but: 1) Because the color uses a low brightness value to get the dark brown shade, the image in blender becomes so dark it is almost black 2) Having to go back and get colors defeats the purpose of using it in Blender (since it would then be faster just to change the color in gimp/ps and then save and update the image in blender) – I guess the real problem is what a low brightness value does to the image --> since it seems to blacken the entire final image instead of just the overlay layer.

Got an update for anyone that cares- found that adding a HSV node and artificially pumping up the value will eventually fix the darkness problem coming out from the color ramp node. Though that still does not explain why the color ramp value is effecting the entire image instead of that “layer” so to speak. Also, changing the mix position of the original image makes a slight different (basically if you want any white or not). Not quite there yet, but the result is a mammoth improvement over the original.

Attachments



interesting setting

can you show whole nodes set up
problem here is which color do you select these colors seem to be close colors and difficult to pick the right one!

which texture did you use for this would like to try this ground texture
l
happy bl

I second that; instead of whole node setup would you mind enlarging a bit on underlaying idea of connecting 4 nodes as we see on the screenshot in #1.

I don’t know why you need to use a color ramp node - I use a color mix node set to any of the mix modes I like (multiply, overlay,etc) and plug my texture into one socket , and set my desired color in the other. The color mix node has a value slider that actually allows more than 0-1 if you type into it.

i think color ramp might give more color shadings for the ground patches
but would like to experiment with this

happy bl

But in this case, the color ramp should be used with its normal black and white stops and fed into the factor of the color mix node set to Overlay, not used to generate the color itself.

i prefer more color variations then only 2 colors for the ground
which would be for natural!

so color ramp can help but a gradient would also be nice !

happy bl

@ Craig Jones, Ricky Blender, eppo: Sure, I’ll elaborate on the concept/process.
I’m trying to devise a better (better/faster) way for me to texture objects/scenes which will then be exported to a game engine (which also means everything needs to be “bake-able”. When texturing objects and especially when making large land or terrain pieces (which is what this is all about), I have to work to hide the tiling that inevitably occurs when using a limited number of samples. I use a material node setup that allows me to overlay textures using alpha maps (like a unlimited chained stencil map) so I can modify any given texture in the stack (like playing with scale, color levels, rotation, location, etc) all to increase the perceived “unique-ness” of the repeating terrain without needing to modify the base image.

However, you can only disguise 1 sample so many ways and even then if the player is looking at it long enough, they will notice that the terrain is just 1 or 2 textures being re-worked a few different ways. The only real way to get variety is to use different samples, but of course those samples do not match your base. Now depending on the terrain, using samples with different textures (smooth sand, grainy dirt, etc) can all be mixed or be placed where they would occur in real life. Color, on the other hand, is the factor that limits using the sample “as is”, since high or sudden variation in color is quite jarring and usually doesn’t look good.

So now I’m thinking that what I should do is just texture with grey scale samples (using my material node setup) until I have the mix that I like, then using texture nodes, apply color to the samples in a way that makes sense for the terrain. This allows me to stay in Blender and make quick changes to my source material without having to jump out to a external editor, make a change, save it, go back to blender, the update the source image (possibly for many images). It would also allow me to view results in real time.

That essay leads to what I’m doing now:
The idea is simple, de-saturate the sample image, then color it using a color ramp (either with a gradient or constant color), then mix it with the gray scale image to produce a colored result (as if it were done externally). The problem was that when using a dark shade of a color (well any shade, but darker shades make the problem much worse), instead of just making the color dark, when it gets mixed in with the original sample, it takes the Value and applies it, making the output almost black (instead of keeping Value “in its own layer”). So now, I’ve added a HSV node to artificially increase the Value to get the image approximately close to its original brightness. However, I’ve also noticed that after I did this, even when using the exact color from a external program, the color in blender is wrong (dark brown comes out as a semi-bright orange), so I have to eyeball the color from scratch.

If you would like to take a shot at it: [for whatever reason, I can’t get the files to upload, so I’m making a .ZIP, and that didn’t work either…so here is a link to the .ZIP file:

http://rapidgator.net/file/00d398887d5eb69efea354f79942edd9/Texture_Node_Files.zip.html

Original Nodes - is the first time I tried this

New Nodes - is what I’m using now

dirt 1024 de-saturated - the base image used externally and in Blender

External Program Color - is the color from using a shade of dark brown in Overlay mode in an external program (HTML 3f1c02)

Color Ramp Constant - new nodes using a constant color

Color Ramp Linear - new nodes using a black to color ramp (using black makes the image much darker, I need to increase the values about 4.5 times higher than with a constant color, so the brightness is not quite a match between the images but I tried to get it close).

Ancillary Notes:
I’ve thought about using more color variation in the ramp, but I’m concerned that if I have a dark color moving to a bright color, I’ll have to increase the brightness to show the dark color which will make the bright color into some sort of glowing neon monstrosity (and necessitate more color correction).

If I load a image as a World Texture, then use that texture as a Material Texture, does that mean I can even have multiple colors for a given sample? (since the nodes are only operating on the Material Texture and not the actual World Texture // or by just adding more colors and Output nodes)

I’m using the RGB to BW node because whenever I see a tutorial done by someone that actually knows what they are doing, they use it (though I can’t see any visual difference if I don’t use it).

Swapping Mix Node spot 1 and 2 changes how much “white” shows up in the image.

having problem with site for file

can you upload at pasteall site may be which is way easier to download !

for seamless you still have to make your iamge seamless in GIMP !
mind you there may be a trick in bl to make it look seamless too!

thanks

Looked at pasteall, thought it was weird, posted pics to Photobucket: [hopefully this works for you]

2 other notes:
I know what you mean about the seamless thing, but that isn’t the problem, given enough repetitions , even seamless textures will create a obvious tiling effect (see pic), and needs to be disguised.

I tried using a color ramp that contained a dark shade and a light shade, and as I was worried about…brightening the dark shade makes the light shade glow. So they need to be 2 separate colors, but I haven’t figured out how to limit them to only working on certain light/dark value ranges…


pastal is eay
just click on upload button then it will comeback with a new page i think then copy at top the URL
and that’s it
good up to 5 < MB i think

would be nice to see file to test it

for color may be try with a gradient color or color ramp where you set different color slots

also don’t see nodes set up
but you might be able to ovelay some noise texture which may help get rid of the seams!

happy bl

The node setups are “old nodes” and “new nodes”

if nodes set up is not too big
can you show it

are you using image text or proc text here

salut

The original node setup can be seen in my 1st post. The current node setup can be seen below:


Played around with getting a 2nd color in the texture (using a texture that has a very different hue and value), and so far the solution is a lot cleaner than I expected (in terms of node setup). In the pic below, notice the green hue added to the brighter areas of the image (the green has been capped from influencing both the lighter and darker colors). You will also notice that many of the “small dirt pieces” also are green, and I don’t think any amount of color definition will change that since those small pebbles share the same color as some of the larger dirt chunks. So it is not a perfect solution. I could of course always just paint the color in after baking (or paint the grey scale image), but I always try to save as much time up front as possible.