How to fill different color for each section on a square which is divided by a single line? - adobe-xd

I'm a newbie for Adobe XD and I was trying to fill different color for each section on a square, where square is divided by a single line. When I'm trying to fill it, it's automatically fills all over the square.

Please use a gradient for multi-color in a box.
See the below pic

You need a gradient that starts with a red color for example, then at the middle position add another red color. Next to it a blue and at the end the blue color again.
To translate this to positions that would be:
red at 0%
red at 50%
blue at 50%
blue at 100%
This will create a gradient with 2 colors, but instead of gradually fading from one to another, you have a harsh jump at the 50% position from red to blue.

Related

Morphological image processing

i am working on a project where i need to do some image processing, where i am not an expert.
I have an image obtained from QEMSCAN technology,as you can see here pink pixels represent the existence of the gold. there are 3 types of gold, type 1 where the connected pink pixels are surrounded with white ones. type 2 when the connected pink pixels are surrounded with white and another color.
type 3 where the pink area is connected with another colors except white.
I did some morphological image processing to isolate each area containing gold, but I'm blocked right now how i can determine to which type belong each pink area
thanks in advance
determine the type of gold
image
Here's a possible approach:
make all the pink pixels white and everything else black
do a dilation and find the coordinates of the additional pixels
check the colour(s) of the additional pixels in the original image

Detecting anti-aliased or undersampled text image

I have an image that is essentially a text document (black and white) but due to anti-aliasing/undersampling applied during scanning, the image contains a lot of color, light tone pixels and is thus saved as a full-color image i.e: takes a lot of space.
My goal is to be able to detect Black and White image candidates in order to convert them from full color to B&W which dramatically reduces their size.
Is there a way to detect such anti-aliased/undersampled images? Doing color pixel analysis doesn't help because the colored pixels end up being close in amount to the black pixels... Essentially I want to be able to detect that the colored pixels come from anti-aliasing/undersampling a black & white image and not from a picture type image.
Here is an example image:
As you can see there are many more colors than just black. However this image is a good candidate for Black & White / Greyscale conversion instead of full color. How can I detect such images? Please note that in this example the colors tend to be on the grey side but there are many cases where they are cyan or brown etc.
I think it is a valid question. I don't have 50 reputation to post a comment so I will post this as an answer.
Basically, in a black and white anti-aliased image the various grey colors are opacity differences of the black color. If we observe those pixels they will be like these listed below. So, if the operation is a color manipulation then apply the same opacity picked up from those grey pixels to the new color.
rgba(0,0,0,0.6)
rgba(0,0,0,0.9)
rgba(0,0,0,0.5)
rgba(0,0,0,0.9)
rgba(0,0,0,0.6)
rgba(0,0,0,0.1)
rgba(0,0,0,0.5)
In my opinion, the pixels other than grey, in this example image, cyan and brown as it appears can be safely ignored because they seemed like not part of the original text. If there were a few more example images of non grey pixels would have been good. But if we cannot ignore them just need to get the pixel opacity and apply the same color manipulation. In other words we treat them as black pixels.

Setting the background to transparent using GIMP

Using GIMP 2, I have an image of a grey chair on a white background, as below:
I now want to set the background to transparent. Therefore, I decided to use GIMP's "Color To Alpha" tool. So, I told it to set all pixels which are white (255, 255, 255) to transparent, as below:
This did set all white pixels to transparent. However, it also set the grey pixels on the chair to be partially transparent, as below:
So when I export this image and place it in front of a background, there is no white box around the chair -- but the background partially shows through the chair.
What am I doing wrong?
First, this question is offtopic here, and should be on https://graphicdesign.stackexchange.com .
Second, it is trivial enough just to answer: the color to alpha plug-in is not there to turn a single color, as seem on the image, to transparency: it is a sophisticated plug-in that will remove one color of your image in a way that, if you lace the new image over a background of the same color the color you removed, you get the original image back.
Thus, in your case, it removed the "whiteness" of your chair, transforming all pixels to different opaque shades of black - so that when placed over white, you get the original image.
To simply remove the white, you have to cick on the Select By Color tool (by default th 5th icon on the toolbox), click on the white background to have it selected, and then just edit->cut. (It won't work if your image layer does not have transparency to start with - if that is the case, prior to edit->cut do Layer->Transparency->Add Alpha Channel).
If you get aliased borders, then, after edit>cut, but prior to dismissing your selection, you can do Select->Border... by 1 or 2px, and then use the color to alpha filter with White on this selection.
For more information on Color to Alpha, I have this other answer its use and comparison with edit-cut here: https://graphicdesign.stackexchange.com/questions/28058/gimp-color-to-alpha-is-not-selectable/28097#28097
Just use a selection to restrict the action of Color to alpha where it matters: backgroundand edge pixels:
Select background with fuzzy select
Select>Grow by one pixel so that the selection ofverlaps the edge pixels
Color>Color to alpha

Determining rgb planes of a color image

What is meant by red,green or blue plane of a color image?How do we generate the red plane?how is it different from the other planes?Please explain the logic behind generating these planes?
Every pixel in a normal colour image is made up of a red part, a green part and a blue part - hence RGB image. Typically there is one byte for the red part at each location in the image, one for green and one for blue. As there is a byte for each pixel location, the red can vary between 0 (zero) which means "no red" and 255 which means "full red". Likewise the green and blue. So an image where all the pixels are
Red=255, Green=0, Blue=0 will look very bright red
Red=0, Green=255, Blue=0 will look very green
and a pixel where R=G=B will look grey, and if R=G=B=16 it will be very dark grey, and if R=G=B=240 it will be very light/bright grey.
So, the "red plane" is merely an image that only shows the red part of each pixel, or how much red there is in each pixel.
Here is a rose:
and here is the red plane, and you can see that where the rose is very red, the red plane is very bright meaning there is lots of red.:
Here is the green plane (you can see the green leaf on the right is bright):
and the blue plane (you can see the blueish petals on the left are bright):
If you want to separate the color channels (planes), it is very easy in ImageMagick to get the red plane, for example:
convert rose: -channel red -separate red.jpg
ImageMagick is free and amazing - available here.
Simple answer:
Say you read a 480x640 color image, like so:
A = imread('image.jpg');
The matrix A has dimensions 480 x 640 x 3. The third dimension are three 480 x 640 planes, or color channels:
red = A(:,:,1)
green = A(:,:,2)
blue = A(:,:,3)
Now you can go to the link #Trilarion gave in the comments and look at the portion about Truecolor Images.
If I understand your comment, you want to know how a CCD of a camera catch the chroma of each color.
Have a look to color space
And maybe about wavelength of colors (Look at the table of color frequency/wavelength for more informations)
And camera CDD to understand how camera catch those wavelenght and create color channel of an image.

Detecting a circle of a specific color (or gray level) with openCV

Is there a way to detect a circle with a specific grey level using openCV? I want to detect a circle that marks out from the others.
Currently, I'm using cvHoughCircles to detect my circles. I know the method returns an array of cvSeq containing the info on each circle (point and radius), but it does not provide any color information.
Thank you
You should first isolate the colour you want, and then do a houghcircles on that image.
Say you want to find green circles from a bunch of green, red and blue circles. Its simple in this case, just threshold the green channel. You'll get only the green circle in the thresholded image. Do a sobel/canny on it and execute houghcircles.

Resources