Dominant color and color mask

Hi,
    1. How to find which is the dominant color in an image,which method can be used to find it ?
    2. How to apply color mask to an image?
Thank you
Mdhubalan Panneerselvam

Hello Madhubalan,
maybe this can help you get some ideas about finding the dominant color. I am attaching a VI that uses three different methods to determine the dominant color:
1. Red or green or blue (only one of the three, no colors in between)
2. Hue based histogram
3. K means clustering based (you need to install the library from clustering)
The first method returns only red or green or blue value based on the maximum values of the rgb planes.
The second method uses a hue histogram where the rgb values are recalculated. The problem here is the saturation and luminance - the code takes the mean values of both, so its off sometimes.
The third method produces most acurate results, as far as i have been testing it.
If you like, you can test the code, but maybe someone with more experience than me can provide a better solution.
Anyway, I hope this helps you to proceed in the right direction. Aslo, sorry for the dirty and unoptimized code.
I do not understand what did you mean with the color mask?Could you please explain in more detail?
Best regards,
https://decibel.ni.com/content/blogs/kl3m3n
"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Attachments:
dominant color.vi ‏58 KB

Similar Messages

  • Line Color and color shadow in smartform with release 46c

    Hi, we have a sap system release 46c.
    We are developing a smartform, the smartform have a template with multiple box,lines and columns.
    We want that the lines will be in one color and some of the box will be filled with a color.
    Is possible have color lines in smartforms in release 46c ?
    Is possible to fill a box with a color in a smartform in release 46c?
    Thanks in advanced.
    MANUEL
    PS. We are using a template to draw the box.

    When you Creating Lines in Tables OR when you creating Templates in SMART FORMS,
    You can specify FILL COLOR for each CELL/ROW/COLUMN of Table or Template.
    For that you must choose Item(table/template) in Tree in smartforms.
    Then you must choose Cell(s) which you want to color-fill, and then choose color from "Shadowing" OR "Shading" ("Оттенок" on Russina) color-menu.

  • Substitute colors and color shades

    We are looking at re-painting our house.  I have scanned in some of the colors we are thinking about.  I have taken some pics of our house and want to introduce the colors we have choosen.  There is shade that also has to be dealt with and hence the same color in shade will have to be accepted as well.
    What is the best method/tool to use for this task ?

    Since it's easier to point you toward some tutorials on that very subject than illustrate the different ways on the forum, here are some:
    http://projectwoman.com/2009/03/photoshop-change-the-color-of-your-house.html
    http://www.youtube.com/watch?v=VhUbA82E2tU
    http://www.youtube.com/watch?v=R8ucMyWRBrQ

  • Color and Color Management boxes in Print Settings greyed out. Using PS CS5.1 with Mac OSX 10.9.5.

    For some reason, the above boxes are now greyed out when I go to Print Settings and I am getting prints that are badly distorted. Was working perfectly a few days ago and can't understand why this has suddenly happened ?  Am now confused as to what settings I should have in the Color Management dialogue box in order to get back to the correct operation.

    I've also been having this problem. My computer now consistently shuts down between 10 seconds and 2 minutes of startup. This only happens if my computer is not plugged in. (my battery has been between 70-90% the entire time.) If I keep it plugged in...no problems.
    13-inch, Mid 2013 MacBook Air
    1.3 Ghz Intel Core i5, 8 GB 1600 Mhz DDr3).

  • How to solve illustrator cs6 save as cs5 problem about the stroke(when the stroke with clipping mask and color is gradient, save as cs5 will change to embed ).

    how to solve illustrator cs6 save as cs5 problem about the stroke(when the stroke with clipping mask and color is gradient, save as cs5 will change to embed ).

    Because it was not possible to apply a gradient to a stroke in CS5. When you open the file in CS5, it is reduced to something that can be rendered in CS5.

  • Error Compiling when using RGB Color Corrector and Unsharp Mask

    If I apply the RGB Color Corrector and and Unsharp mask to a clip within a sequence and try to render the sequence or a small portion of the work area I get the Error Compiling: Unknown error.
    This is occurring within a project I have updated to Premiere CS6 from Premiere CS5. 
    I have tried creating a new sequence and importing the same clip and other clips.  Anytime I try to use both the Unsharp Mask and RGB Color Corrector I am unable to render.  I have tried this with Mercury Playback both in hardware and software modes with the same result.
    Has anyone else seen something like this?

    Okay, glad this occurs for others too and I am not experiencing something isolated. The issue here is this shouldn't be happening at all. 
    Premiere CS5 has no problem with this.
    Yeah if I turn off one effect or the other no problem.  Unfortunately it doesn't matter the order I place the effects in I get the same error regardless of which is placed first.
    Nesting does work.  If I create a sequence, apply one or the other to the clip in the sequence then embed the sequence in another sequence and apply the remaining filter to the sequence containing the clip then I can get my color correction and edge definition.  But this is a work around. 
    There seems to a bug here since there were no issues when using RGB Color Corrector and Unsharp Mask simultaneously applied to one clip in CS5.  I doubt there will be a fix for this anytime soon so it looks like I will have to use another method for color correcting or apply RGB color correction to clips already embedded in a sequence as I move forward into solely using CS6.
    (How this can become an issue is that after applying effects and color correction to several clips within a sequence I like to render that entire sequence.  Then this sequence is ebedded in another main sequence and I can add additional effects and transitions and overlays without killing the live playback speed and only have to render smaller amounts of content from additional tracks.  It ends up saving a lot of time after the initial length of rendering.)
    Thanks for the suggestions.

  • Action help to copy color in layer mask to another layer mask

    Hi all,
    Having trouble with this problem...
    I have layer 1 with a color mask set to black, red, blue etc.
    I have layer 2 with a color mask which i want to match and also become black, red, blue
    There are hundreds of files, and the color in layer 1 is always different.
    Manually i would simply click on the layer 2 mask which opens the color picker, and select the area of layer 1 i want to match.
    But doing that in an action does not work.
    I can't get the action to recognize that i want to copy the color content of a mask, and not the specific color used in the example during which the macro is recorded. The color picker does not seem capable of selecting a dynamic input (e.g. whatever color is on layer 1), it simply copies whatever was in layer 1 during recording like a dumb instrument.
    thanks for any input.

    Not sure what you mean by color mask, but I just noticed cs6 seems to have a new feature in the actions tab dropdown menu (small top right button) called 'allow tool recording'.
    I just tried to make an eyedropper action with that option turned on and now the color does change when I change the image colors and run the action again.
    Hope this helps.

  • How do I make the background of a photo one color and the object another color?

    I have a photo of a windmill with the sky and clouds as background.  I would like like to keep the clouds as is and change the color of the windmill.  How can I do this?

    You can use the HSL panel to change relationships between tones and colors. For example use Luminance mode to darken a sky by adjusting the blue and aqua channels or use Saturation mode to make an image monochrome except for one dominant color.
    If you want to change color completely first use the HSL panel to remove color and then paint with the adjustment brush set to a solid color; although that’s a bit more tricky.
    See examples below:

  • AE CS6 - 3D Compositing and Color Correction workflow

    AE CS6 - 3D Compositing and Color Correction workflow
    Hello everybody,
    I have some questions about work flow in AE concerning compositing and Color Correction. I saw many tuts about (f.e. Lynda.com Premiere Pro Color Correction and Enhancement... and tuts by Andrew Davis here in creative.cow).
    Essentially, he have this CC work flow:
    GRADING (primary and secondary)
    Adjusting Tonality (Brightness and Contrast)
    Adjusting Colors (White balance and fix color dominance)
    MATCHING
    Conforming colors of different clip shoted with different camera and lighting set up.
    ENANCHING LOOK
    Giving to all clips a unique "look"
    But what does it  happen if we have NOT just some clips but ALSO a 3D object (rendered in a 3d sw or, actually also a 3d object inserted by 3D Element by videocopilot)
    or/and
    a keyed clip from a green screen shot?
    How does this footage (3d object and green screen keyed shot) transform
    the aforementioned work flow?
    We have to consider that this footage (3d object and green screen keyed shot) must to be pre-multiplied to make a right compositing but when you make CC it must be again "straight"... (NOT pre-multiplied)
    Is really hard also understand how dale this work flow between AE and Pre Pro if you want to make CC in Pre Pro after compositing in AE.
    I try to present a work flow for this (very common) situation:
    I have a landscape clip as a background
    a keyed clip (pre-multiplied) with a Character watching sky
    and a 3d (pre-multiplied) object U.F.O. on sky.
    When I have done compositing, how make I a right CC of all footage if I have two clip (3d object and green screen keyed shot) still  pre-multiplied?
    I think, but I'm not sure, that should be a good idea to send to Pre Pro a composited Comp with separate layers (by dynamic links)  to have  all single separate layers (Background, 3d object and green screen keyed shot.. but also the Color Warping...!). Than, in Pre Pro you should make a CC (Grading)  just for a BG and than try to Match (Matching) this color corrected BG with 3d obj and keyed shoot. But we have a problem at this point cause our 3d object and green screen keyed shot are still pre-multiplied, and before make matching we have to re- multiplied theme, but how? And if we re pre-multiplied them, compositing will be also right?
    Or maybe, before exporting comp from AE to Pre Pro, he have to create both layers for 3d object and green screen keyed shot, one pre-multiplied and one "Stright"? But, again, how to combine them to have a right compositing and a a right CC?
    Anybody can help me to understand or maybe suggest any tuts to dale this common issue in AE- Pre Pro?
    Many, many thanks!

    Dave is correct. (And so is Mylenium. No need to be rude, when he was jsut trying to explain that you were introducing unnecessary complexity.)
    The color matting is removed to interpret the alpha channel when you import the footage. After that, any color correction that you do to a layer based ont hat footage item doesn't have anything to do with whether the channels were straight or premultiplied for the source item.
    You color-correct your individual items to amke them match as part of the compositing process in After Effects. Then, if you want to do a color grade of the shot in Premiere Pro along with other shots, you'd be working on the single rendered/flattened composite, so the details of the original elements that went into the composite are irrelevant.

  • The tool bar is missing for font,size and color for lettering in elements 9

    Iam missing tool bar for font, style and size and color. where is it?

    Are you sure you have the regular horizontal or vertical type tool and not one of the type masks selected? If you choose the type mask tools you see a dotted outline around the T icon instead of a solid T.

  • Select color on clipping mask

    When I have created a clipping mask and want to select a color from the layer behind I have to select the layer to get the color and then go back to the clipping mask to use it.
    I have seen Tutorial on the net where they dont seem to have to do that.
    So what am I doing wrong here?

    What are the Eyedropper Tool settings in the Options Bar?
    Do the top Layers hide the base Layer of the Clipping group completely?
    Could you please post a screenshot with the Layers Panel visible?

  • Has somebody worked with Color and The matrox mxo ???

    So,
    i have digital postproduction in hamburg germany.
    We have two 5D Cyborg Online Systems, 3d Workstations with xsi,
    and an Mediacomposer.
    So last Year we started to do onlinening on Set for digital shooted
    highspeed tv commercials (With the Weinberger Sppedcam).
    We do this with on of our mobile 5D Cyborgs Systems.
    Which i think, is one of the best Online systems still on the Highend market.
    But Colorcorrection is more and more Important specially with digital shooted footage.
    So the ColorCorrection tools in the Cyborg a pretty nice.
    But I wanted a portable Colorcorrection Tool/system for deficile Corrections.
    So i heard about Silicon Color.
    So now I´ve bouht FCS 2, and i already had a AJA Io La Box.
    Color don´t give me a Videoout over this to my Sony Class A.
    So how ist the Quality from the MXO on a Apple Cinema , like a Sony BVM Class A ? is it a reference Picture ?
    Second Question
    How is the Workflow, because with a mac book pro, a calldigit raid and color, you need a secondary displa for the scopes and the workpicture ( masking etc).
    Is the Presenationmodus from the MXO in the same Quality of the Mastering Mode.
    And is it ease and fast to switch between them.
    Thanks to all
    mario
    Hamburg

    check out this thread on a nother forum:
    http://forums.creativecow.net/cgi-bin/newreadthread.cgi?forumid=223&postid=1519&univpostid=1519

  • Feature request : color fill vector mask thumbnails in layers panel

    I find that the color fill vector mask previews within the layers panel are not as helpful as they were in CS5. Having the vector path along side the color swatch worked better.

    You should know that others have requested this, starting with the public beta.  I happen to agree with you on this, showing the color and shape separately was more useful.  But it must have been difficult for new users to understand or something.
    There's a known bug that causes the shape icon to be hidden sometimes behind the little overlay.  Adobe is looking into fixing that, and with some luck in an update we'll see the shapes become more visible, but of course this doesn't help with the shape of things like thin lines that you can't see at that scale, and complex coloring (e.g., gradient fills) doesn't show at all.
    It would be great if they'd offer an option to display an additional color icon - if not in the Layers panel then in the Properties panel!
    Oh, and I suppose it should be pointed out that fill layers with PIxel masks (vs. shapes, which are fill layers with vector masks) still look the old way.  I don't know whose idea this was, but it seems a little half-baked.
    Unfortunately, Adobe does not have a habit of changing functionality in any significant way after release.  I think we're stuck with what we have, save for maybe that bug fix I mentioned.
    -Noel

  • Matching opacity and color

    I am quite new to Photoshop, running CS4.  I have a map which I must match the color and opacity.
    Matching the color is easy, just use the Eyedropper Tool or Color Sampler Tool
    The Opacity is the hard one to match.

    Morning Semaphoric,
    Tried what you recommended, but I think I must be missing something, being so new to Photoshop.
    I entered Quick Mask mode, selected the area, and the RGB values came up no problem, but the K% (for the opacity / transparency value) was "0".
    So I tried the Colour Sampler tool, again the RGB values were bang on, but there was no opacity value indicated.  I must be missing something.
    I'm coming to realize that maybe I have to replace all the previous coloured areas with my own opacity value.  It's unfortunate that my colour perception is not as good as I'd like, my wife says I'm colour blind.
    Regards,
    Alan

  • Printing with HP B9180 and Photoshop Elements 8 and Color Management

     I've got a bit of confusion about certain settings in the printing process and I've posted a rather long discussion of my 'issues' and confusion.  I hope someone can give me some guidance here.  I've seen a lot of these issues addressed in many places but I can't seem to find an integrated response.  Thanks to anyone who takes the time to read and respond.
    Color Management Questions
    My problems started when I was getting pictures that were too dark from my HP 9180 printer after having gotten very nice prints for a long time.  I had obviously started to do something differently inadvertently.  The only thing I think that is different is that I got a new 23 inch monitor, which does produce much brighter on-screen images.  So, I started to do some research and know just enough about color management to be slightly confused and have some questions that I hope someone can give me some help with.
    Equipment Background
    I use both a Canon 20D and a Canon PowerShot SD600 camera. Both have the default color space as sRGB, although the 20D can be also set as RGB.
    I also use Photoshop Elements 8, where there are a variety of settings possible for printing.
    My monitor is an HP S2331, whose color space is sRGB and cannot be reset to RGB (I think) except for temperature; the default is 6500K.
    My printer is an HP Photosmart Pro B9180 Printer, where there are also a variety of settings possible.
    I’m running XP-Pro.
    Here’s Where I Get Confused
    Everything I have read about color management (various web sites, forums, books, etc) says to have the image, monitor, and printer all in the same color space.
    Everything I read about PSE 8 (same sources) says to set PSE 8 to ‘Always Optimize for Printing’ under Edit>Color Settings in order to get the best prints.  This displays photos based on the Adobe RGB color space. 
    I am taking pictures in sRGB, and telling PSE 8 to process them in RGB by selecting ‘Always Optimize for Printing’.  Is this something I should be concerned about?  Should I reset my camera for RGB?
    Further, by selecting ‘Always Optimize for Printing’, I am setting PSE 8 for RGB while my monitor displays sRGB.  Is this an important issue or is it also much ado about technicalities that an amateur should not worry about?  It does violate the ‘keep them in the same color space’ rule.
    Next, when I go to File>Print and get the Print window and then do the Page Setup and Select Printer, I then go to More Options in the lower left of the window.  Under the More Options window, I select Color management and select Photoshop Elements Manages Colors.  Next, there is Image Space, which is fixed and not subject to selection from a drop down menu. 
    I understand that this is the image space of the image I took with my camera and that information is embedded in the image.  Correct?
    Next, there is Printer Profile.  But, from what I have read, this is where the IEC profile of the paper being printed on is supposed to be selected, isn’t it? 
    Shouldn’t this more appropriately be called Paper Profile, or Printing Media Profile?  Further, this drop down menu appears to be somewhat erratic, sometimes showing all of the paper profiles I believe are loaded, sometimes not. It also shows listings such as Working RGB-Adobe RGB (1988), Adobe RGB 1988, Dot Gain 10%, 15%.... along with a lot of paper profiles.  Aren’t those profiles unnecessary here?
    I’ve used both Relative Colorimetric and Perceptual Rendering and am happy with either one. 
    Next, when I go to Printer Preferences, in order to “…disable color management in the printer preferences dialog”, under the Color Tab, I select Application Managed Colors from the Color management drop down menu, and also have the option of selecting ColorSmart/sRGB and Adobe RGB (1988).  
    Is there any time when I should use either ColorSmart/sRGB or Adobe RGB  (1988)?  If I were staying with my camera’s sRGB setting, given the fact that the monitor is sRGB, would the appropriate selections be ‘Printer Manages Colors’ and ‘ColorSmart/sRGB’?
    Finally, under the Features Tab, I go to look for the same paper I selected under Printer Profile (Question 4 above).  If it is one of the pre-loaded (by HP) profiles, it is there, but if it is a profile I downloaded, say for an Ilford paper, it isn’t listed, and I need to guess at an equivalent type of paper to select.
    Is there any way to get that listing to appear under the Paper Type drop down menu?
    I know that this is a long post, but it helped me to clarify my ‘issues’.  Thank you for any and all suggestions, answers, guidance and help.

    RIK,
    Some printers have long names, esp. HP printers, and PSE gets ":confused." In control panel>devices and printers, right click on the default printer, go to printer properties, and rename the default printer to something short, e.g. "Our Printer." That may fix it..

Maybe you are looking for