Colorize Layers in Inkscape - diagram

I need to draw a diagram with different colors. Therefore I would like to have one layer per color.
When I add a layer that contains only a rectangular filled with a color above a layer with a white drawing on a black background. Then I can use the "Blend mode" multiply and the white drawing is colorized.
Is it also possible to just colorize everything in a layer that is black?

I don't think there'll be any GUI-based solution lighter than the one you have.
But since you are in StackOverflow, you can probably code. Then you could use a script with a text file parser (such as sed) to modify the colour of desired elements in the svg file.

Related

color blending with GDI+

I am refering to a older question saying color blending with GDI+
Using GDI+ with Windows Forms, I want to be able to draw with a pen and blend color based on the destination pixel color.
For example, if I draw a line and it passes over black pixels, I want it to be a lighter color (like white for example) so that it's visible. When that same line passes over white pixels, it should be a darker color (black for example) so that it's still clearly visible.
the answers says to use a color matrix for transformation
so i started implementing it..
My image is present in raw data format in rgb48
Gdiplus::Bitmap image(input.width,input.height,input.width*6,PixelFormat48bppRGB,(unsigned char*)rgb48);
Gdiplus::Image *images= image.GetThumbnailImage(input.width,input.height);
Gdiplus::TextureBrush brush(images);
Gdiplus::Pen pen(&brush);
Gdiplus::ColorMatrix matrix={
-1.0f,0.0f,0.0f,0.0f,0.0f,
0.0f,-1.0f,0.0f,0.0f,0.0f,
0.0f,0.0f,-1.0f,0.0f,0.0f,
0.0f,0.0f,0.0f,1.0f,0.0f,
1.0f,1.0f,1.0f,0.0f,1.0f,
};
Gdiplus::Graphics gfx(&image1);
Gdiplus::ImageAttributes imageAttr;
imageAttr.SetColorMatrix(&matrix);
gfx.DrawImage(images,Gdiplus::Rect(0,0,input.width,input.height),0,0,1024,1024,Gdiplus::UnitPixel,&imageAttr);
I am not getting what i expect..Can some one help me in finding the mistake i m doing.
You can use the alpha component of a color to specify transparency, so that colors can be combined. However, if you want the combination to be something other than the alpha blend, you must draw the pixels yourself. You could first draw into a transparent bitmap, then render that onto the destination pixel by pixel.

Remove the picture edges

I downloaded a icon, and now i want to reset the color of it, but i'm not good at photoshop, i've set the color of it to be red, but there are to many edges and corners, please tell me how to remove those edges by using photoshop step by step, thanks a lot.
here is the icon i downloaded:
and this is my ugly one:
The best way to alter a single color like this on a simple image such as this is to alter the Hue and Saturation [CTRL / CMD + U]...
This allows you greater color control and keeps the anti-aliased edges of the image intact.
Most beginners alter colors like this by simply selecting the color with the wand, or using the paint bucket on the color. Unfortunately this usually does one of 2 things:
Makes the ragged edges that you saw.
Leaves a halo of the old color as an orphan.
I did this in a few seconds with that tool:

Photoshop alter colors in blue white

I'm trying to make an header in Photoshop but I want the image I use to only have two base colors.
Just like:
How do I make this happen? And is it possible to just adjust one layer?
Basics is use hue/saturation in Image>Adjustment>hue/saturation tick the colorise in the bottom and enjoy colouring

How can I get background color of a layer in Photoshop?

I have a design in .psd format. It is using various layers and diffrent settings for opacity. I am using Photoshop CS3. How can I get background color of the layer. One way is to use in-build Color Palette utility but that doesn't suits me. I want a way by which I can get exact Brush that is used for the background. It may or may not have Gradients.
Not that this is programming related, but use the eye-dropper tool.
http://www.ehow.com/how_2193268_use-eye-dropper-tool-photoshop.html
Once the color is placed into your "foreground color" box, click the box and it will show you the color in RGB, Hex, and pretty much any other way you can display a color value.

Find most readable colour of text that is drawn on a coloured surface

I'm not sure how to ask this but here goes.
I draw a filled coloured rectangle on screen. The colour is in form of R,G,B
I then want to draw text on top of the rectangle, however the colour of the text has to be such that it provides the best contrast, meaning it's readable.
Example:
If I draw a black rectangle, the obvious colour for text would be white.
What I tried right now is this. I pass this function the colour of the rectangle and it returns an inverted colour that I then use for my text.
It works, but it's not the best way.
Any suggestions?
// eg. usage: Color textColor = GetInverseLuminance(rectColor);
private Color GetInverseLuminance(Color color)
{
int greyscale = (int)(255 - ((color.R * 0.30f) + (color.G * 0.59f) + (color.B * 0.11f)));
return Color.FromArgb(greyscale, greyscale, greyscale);
}
One simple approach that is guaranteed to give a significantly different color is to toggle the top bit of each component of the RGB triple.
Color inverse(Color c)
{
return new Color(c.R ^ 0x80, c.G ^ 0x80, c.B ^ 0x80);
}
If the original color was #1AF283, the "inverse" will be #9A7203.
The contrast will be significant. I make no guarantees about the aesthetics.
Update, 2009/4/3: I experimented with this and other schemes. Results at my blog.
The most readable color is going to be either white or black. The most 'soothing' color will be something that is not white nor black, it will be a color that lightly contrasts your background color. There is no way to programmatically do this because it is subjective. You will not find the most readable color for everyone because everyone sees things differently.
Some tips about color, particularly concerning foreground and background juxtaposition, such as with text.
The human eye is essentially a simple lens, and therefore can only effectively focus on one color at a time. The lenses used in most modern cameras work around this problem by using multiple lenses of different refractive indexes (chromatic lenses) so that all colors are in focus at one time, but the human eye is not that advanced.
For that reason, your users should only have to focus on one color at a time to read the text. This means that either the foreground is in color, or the background, but never both. This leads to a condition typically called vibration, in which the eye rapidly shifts focus between foreground and background colors, trying to resolve the shape, but it never resolves, the shape is never in focus, and it leads to eyestrain.
Your function won't work if you supply it with RGB(127,127,127), because it will return the exact same colour. (modifying your function to return either black or white would slightly improve things)
The best way to always have things readable is to have white text with black around it, or the other way around.
It's oftenly achieved by first drawing black text at (x-1,y-1),(x+1,y-1),(x+1,y-1),(x+1,x+1), and then white text at (x,y).
Alternatively, you could first draw a semi-transparent black block, and then non-transparent white text over it. That ensures that there will always be a certain amount of contrast between your background and your text.
why grey? either black or white would be best. white on dark colors, black on light colors. just see if luminance is above a threshold and pick one or the other
(you don't need the .net, c# or asp.net tags, by the way)
You need to study some color theory. A program called "Color Wheel Pro" is fun to play around with and will give you the general idea.
Essentially, you're looking for complimentary colors for a given color.
That said, I think you will find that while color theory helps, you still need a human eye to fine tune.

Resources