Modifying colors in images

I am trying to create a vi in Labview 7.1 that will upload an image from a jpeg file, modify the color and luminance of the image, and then output the image as a jpeg file. I am currently able to input and output the image to a file, but I am having difficulty modifying the colors of images. I read in a manual that the color control was a 32 bit array, but when I try to make my own array and wire it to the color control on the image block, it breaks the wire and won't let me make the condition. How do you design a proper array to set color and which array elements correspond to red, blue, green, hue, luminance, and saturation of the image? I am able to manually adjust the color and set my own color in rectangles, but I wanted to create an automated process with an array to automatically generate a range of colors.
The other problem I was having was getting the image to be displayed on the visual panel of Labview. I can import and export the jpeg file, but I cannot get it to be displayed on the grid. I would greatly appreciate any assistance and advice you have.
Thanks,
Daniel

If you are going to do some heavy image manipulation, you may wish to look into a LV toolkit called IMAQ, which allows you to go that way.
If not, you can start by using the standard picture VIs (Graphics & Sound palette), which I assume you already do to read and write the file.
LV treats a picture in one of three formats:
1. Picture - the blue wire. You will need to to use this for any manipulation using the picture VIs.
2. Pixmap. A 2D numeric array in which each cell holds the color value of the coresponding pixel.
3. Flattened pixmap. A cluster holding all the picture information in which the pixel data is stored as 1D array.
There are VIs for converting all these formats.
To replace colors you can simply use Replace Array Subset to replace specific cells either in the 1D or 2D array or use the Draw point VI. The main problem you will have is that you will need to calculate everything on your own. If you want to modify the entire image, you can go over the array in a loop and (for example) increase all values by 1000 and see what that does.
All of this can be found from reading the help files for the VIs (right click>>Help), which is what I suggest you do to learn more about this.
You can display an image simply by converting to the first format right clicking the VI output (picture) and selecting Create>>Indicator. because it's a picture format, a picture indicator will automatically be created.
It sound as if you don't have much experience in LV. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.
Try to take over the world!

Similar Messages

  • How to create 2-color Pantone image from jpeg logo

    Working in CS3 under XP, I need to convert a jpeg rvb image of a logo  into a 2-color pantone image to import it into an Illustrator file. I  can isolate the logo's two distinct colors using the select wand and  then tried filling the selections with the closest Pantone colors, but  the rvb layers still seem to exist. I have saved in .eps DCS2, but the  imported colors when sampled in Illustrator are still rvb/cmyk. Is there  a way to isolate the shapes/colors and then transfer them as vector  images into Illustrator, where I could fill them with the Pantone  colors? Or a simpler way not necessarily using Photoshop? Thanks very much!

    Is this a vector image or pixels? EPS can be both.
    Better than selecting it with automatic functions like magic wand is to draw it manually in Illustrator. If it already is vector (like shape layers), then you can just copy the paths from Photoshop and paste into Illustrator.

  • Exporting photos for UHDTV or Native 4K TV, what are the best settings ? (File: Quality File: Color Space, Image Sizing and resolution)   Or in other words; How can I get the smallest files but keep good quality for display on new UHDTV

    Exporting photos for UHDTV or Native 4K TV, what are the best settings ? (File: Quality File: Color Space, Image Sizing and resolution)   Or in other words; How can I get the smallest files but keep good quality for display on new UHDTV

    You're welcome, and thank you for the reply.
    2) Yesterday I made the subclips with the In-Out Points and Command-U, the benefit is that I've seen the clip before naming it. Now I'm using markers, it's benefit is that I can write comment and (the later) clip name at once, the drawback is that I have to view to the next shot's beginning before knowing what the shot contains.
    But now I found out that I can reconnect my clips independently to the format I converted the master clip to. I reconnected the media to the original AVI file and it worked, too! The more I work with, the more I'm sold on it... - although it doesn't seem to be able to read and use the date information within the DV AVI.
    1) Ok, I tried something similar within FCE. Just worked, but the file size still remains. Which codec settings should I use? Is the export to DV in MOV with a quality of 75% acceptable for both file size and quality? Or would be encoding as H.264 with best quality an option for archiving, knowing that I have to convert it back to DV if I (maybe) wan't to use it for editing later? Or anything else?
    Thank's in advance again,
    André

  • Converting color .jpg image to grayscale

    I have a color .jpg image that I want to convert to grayscale and then add annotation. Is this easy to do in Illustrator?

    Thomas Crowley wrote:
    I've opened the .jpg image in Illustrator. It is a line drawing.
    Those two statements constitute a logical fallacy. A JPEG image is a bitmap, and not, in any way or fashion, a "line drawing". Therefore,
    ...I cannot edit individual parts of the drawing.
    is because the "individual parts" of the image are single color pixels. To "edit" these, you need a bitmap editor.
    It's necessary to say "edit" (w/quotes) because you will be editing pixels. Any notion of 'lines', 'planes', and 'shades' only exist in your mind, and not as physical separate objects somewhere inside the bitmap. If you think you can "select" a big black square "object" in the bitmap editor, well, that's because the software only makes you think you can (it's easy to scan for the edge of a single color filled region).
    ... I just felt you might need to know this.

  • Changing color of Image in PSE 8.0

    I have a logo design that is black on white.  I'd like to change the black to another color - in this case, blue.  I wqas able to do it, but it ended up being quite convoluted.  What are some simple ways to change the color of a selected area in Elements 8.  I'm using a PC, BTW.
    Thanks!

    Thank you.  I found another way that's even simpler.  I chose the paint brush, set the mode to lighten, and then just painted over the image with blue - the white didn't pick up any of the blue, but the black did.
    Date: Tue, 22 Feb 2011 17:02:09 -0700
    From: [email protected]
    To: [email protected]
    Subject: Changing color of Image in PSE 8.0
    1. Select the black (use the magic wand if it's all one color).
    2. Layer>New Adjustment Layer>Hue Saturation.
    3. Turn on the colorize checkbox in the layers panel, and move the sliders till you see the color you want.
    >

  • Invalid color template image

    I try to do patttern matching using IMAQ Vision. Both source and
    template images are .BMP files and are generated in a VB .NET program
    through NI Framegrabber. IMAQ Match Color Pattern gives me the
    following error message:
    Error-1074395384 occurred at IMAQ Match Color Pattern
    Invalid color template image
    Do I have to use .PNG files when doing pattern matching?
    Thanks.

    Hey John123,
    I was wondering what version of Vision that you are using? Have you tried to run any of the example programs, like the ColorPatternMatching example that can be found in the following directory: C:\Program Files\National Instruments\Vision\Examples\MSVB.NET\2. Functions\Color Pattern Matching. I was able to run this example program by using .BMP images and not PNG images. So to answer your question, you don't have to use PNG files with this function, you can use Bitmap images. You can use any kind of image that have a 32-bit RGB or HSL bit depth.
    If you are acquiring from a Framegrabber, I would suggest that you double check and make sure that the images that you are getting from your camera are actually 32-bit, and not 16-bit. Also, you could post a couple of your images on this thread, and I could try them out with an example that uses the IMAQ Match Color Pattern function. Try some other BMP images and do you get the same error? Try the example program, and see if that gives you the error with your images. Let me know if you have any questions. Thanks, and have a great day.
    Regards,
    DJ L.

  • Alpha Color on Images?

    Okay, Let's see if anyone knows this. Let's say I have a Image and I want to make the background transparent. It's certainly possible to load a transparent GIF89A, but say I want a normal gif and I want to "transparentize" it in code. Here's a code I have:
    //Precondition: 'global' is a predefined JApplet
    //                         'opaque' is a predefined Image with w,h > 0,0
    //Postcondition: An Image is returned with the background (as defined
    //                           as the color of the top-left pixel) replaced by the GIF89A
    //                           "transparent color"
    public Image makeTransparent(Image opaque)
      //makes an Image that is the same size as 'opaque'
      Image trans = global.createImage( opaque.getWidth(global), opaque.getHeight(global) );
      //gives me a graphics object to draw on this image
      Graphics g = trans.getGraphics();
      <redraw image substituting transparent for bg>
    }I need to know how to do the <>. My most obvious response would be to go though the Image's array of colors (the way an Image is stored) and change the "bg" color to transparent. But that brings up two questions. (a) Is it possible to access and change that array, and (b) What is the "transparent color" and can the Color object hold it?
    If anyone can answer this question or has another algorithm, I am offering "duke dollars" for this.

    Great news! It worked! Here is the algorithm: All you need is a BufferedImage. It isn't really as inefficient as it may look, either, but don't use it every frame.
    Color bg = new Color(bimage.getRGB(0,bimage.getHeight(null)-1), false);
    for(int xxx=0;xxx<bimage.getWidth(null);xxx++)
            for(int yyy=0;yyy<bimage.getHeight(null);yyy++)
                 if(new Color(bimage.getRGB(xxx,yyy), false).equals(bg))
                      bimage.setRGB(xxx,yyy,0&0&0&0);
    }

  • Where are bg color / bg image in CS 5.5?

    Where are bg color / bg image in CS 5.5? They don't appear in the properties panel when a table is selected. Thanks.

    The background color and background image attributes of the table tag have been deprecated by the W3C and should no longer be used to specify those two things. As a result, they have (rightly) been removed from the table Property inspector). Instead, you are expected to use CSS to apply these two styles to the table in question, e.g.,
    table#thisOne { background-color:#FF6633; background-image:url(path/to/image.jpg); }
    which will style this table -
    <table id="thisOne">...</table>
    with a color and a background image.

  • How to make a Colorful Gif Image for Holi

    How to make a colorful Gif Image for Happy Holi 2014

    Okay, I know this doesn't answer your question, but don't get me wrong. A logo is meant to be the way it was designed - upright, no flipping/ swiveling animation. Why exactly do you want to let your logo turn around?
    If its to grab attention, why dont you consider animating the area on which your logo sits (header)? Or maybe add nice transitive slideshows on your main content area to add more interactivity?

  • Colors and images on itunes U site not displaying correctly.

    After the issues of not being able to login this weekend our site has dropped much of it's theming, including colors and images. The page/course thumbnails still show as well as the background image, but all the other areas look like they are missing the background images. Is anyone else having the same issues with their site. This is the original "private" site, not the new PSM version.
    Thanks,
    Kyle

    Yes, my store and another institution as well - we mentioned the new problem here:
    https://discussions.apple.com/thread/3142618?tstart=0

  • How to get max 5 color from image??

    I try to get max 5 color from image (ex. jpeg,gif) ,I use PixelGrabber
    it too slowly when i use large image,Please help me, to run more fast
    (other way PixelGrabber)
    best regard
    [email protected],[email protected]
    source below:
    public String generateColor(InputStream source,String filePath){
    BufferedImage image = null;
    String RGB = "";
    System.out.println("==generateColor==");
    try {
    image = ImageIO.read(source);
    catch (IOException ex1) {
    ex1.printStackTrace();
    //image.getGraphics().getColor().get
    // BufferedImage image2 = ImageIO.read(source);
    // image.getColorModel().getNumColorComponents()
    if(image.getColorModel() instanceof IndexColorModel) {
    IndexColorModel icm = (IndexColorModel)image.getColorModel();
    byte[][] data = new byte[3][icm.getMapSize()];
    int[] rgbB = new int[icm.getMapSize()];
    icm.getRGBs(rgbB);
    String dataHtm = "<HTML><table width=\"100\" border=\"0\"><tr>";
    for(int i = 0 ;i< rgbB.length;i++){
    int r = (rgbB[i] >> 16) & 0xff;
    int g = (rgbB[i] >> 8) & 0xff;
    int k = (rgbB) & 0xff;
    System.out.println("red:" + Integer.toHexString(r));
    System.out.println("green:" + Integer.toHexString(g));
    System.out.println("blue:" + Integer.toHexString(k));
    dataHtm = dataHtm + "<td width=\"10\" bgcolor=\"#" + Integer.toHexString(r)+Integer.toHexString(g)+Integer.toHexString(k);
    dataHtm = dataHtm + "\"> </td>";
    dataHtm = dataHtm + "</tr></table></HTML>";
    try {
    BufferedWriter out = new BufferedWriter(new FileWriter("c:\\23289207.html"));
    out.write(dataHtm);
    out.close();
    catch (IOException e) {
    e.printStackTrace();
    int w = image.getWidth();
    int h = image.getHeight();
    int[] pixels = new int[w*h];
    int[] pixs = new int[w*h];
    System.out.println("image width:"+w+"image hight:"+h+"image w*h:"+(w*h));
    Image img = Toolkit.getDefaultToolkit().getImage(filePath);
    PixelGrabber pg = new PixelGrabber(img, 0,0, w, h, pixels, 0, w);
    try {
    pg.grabPixels();
    catch (Exception x) {
    x.printStackTrace();
    String picColor = "";
    Stack stackColor = new Stack();
    Hashtable hashColor = new Hashtable();
    for (int i = 0; i < w * h; i++) {
    int rgb = pixels[i];
    int a = (rgb >> 24) & 0xff;
    int r = (rgb >> 16) & 0xff;
    int g = (rgb >> 8) & 0xff;
    int k = (rgb) & 0xff;
    i = i+1000;
    //System.out.println("i:" + i);
    picColor = convertToSring(r)+convertToSring(g)+convertToSring(k);
    stackColor.add(picColor);
    //System.out.println("picColor:"+picColor);
    // System.out.println("\n\n a:" + a);
    // System.out.println("red:" + r);
    // System.out.println("green:" + g);
    // System.out.println("blue:" + k);
    }//end for
    getMaxColor(stackColor);
    System.out.println("==generateColor==end\n\n");
    return null;

    import java.awt.Color;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    public class HighFive
        private void examineColors(BufferedImage image)
            long start = System.currentTimeMillis();
            int w = image.getWidth(), h = image.getHeight();
            int[] rgbs = image.getRGB(0,0,w,h,null,0,w);
            findHighFive(rgbs);
            long end = System.currentTimeMillis();
            System.out.println("total time = " + (end - start)/1000.0 + " seconds");
        private void findHighFive(int[] colors)
            int[] uniqueColors = getUniqueColors(colors);
            int[] colorCounts  = getColorCounts(uniqueColors, colors);
            int[] highFive     = getHighFive(colorCounts);
            // for each value of highFive find index in colorCounts
            // and use this index to find color code in uniqueColors
            for(int j = 0; j < highFive.length; j++)
                int index = findIndexInArray(colorCounts, highFive[j]);
                Color color = new Color(uniqueColors[index]);
                String s = color.toString();
                s = s.substring(s.indexOf("["));
                System.out.println("color " + s + "  occurs " +
                                    highFive[j] + " times");
        private int[] getUniqueColors(int[] colors)
            // collect unique colors
            int[] uniqueColors = new int[colors.length];
            int count = 0;
            for(int j = 0; j < colors.length; j++)
                if(isUnique(uniqueColors, colors[j]))
                    uniqueColors[count++] = colors[j];
            // trim uniqueColors
            int[] temp = new int[count];
            System.arraycopy(uniqueColors, 0, temp, 0, count);
            uniqueColors = temp;
            return uniqueColors;
        private int[] getColorCounts(int[] uniqueColors, int[] colors)
            // count the occurance of each unique color in colors
            int[] colorCounts = new int[uniqueColors.length];
            for(int j = 0; j < colors.length; j++)
                int index = findIndexInArray(uniqueColors, colors[j]);
                colorCounts[index]++;
            return colorCounts;
        private int[] getHighFive(int[] colorCounts)
            // find five highest values in colorCounts
            int[] highFive = new int[5];
            int count = 0;
            for(int j = 0; j < highFive.length; j++)
                int max = Integer.MIN_VALUE;
                for(int k = 0; k < colorCounts.length; k++)
                    if(colorCounts[k] > max)
                        if(isUnique(highFive, colorCounts[k]))
                            max = colorCounts[k];
                            highFive[count] = colorCounts[k];
                count++;
            return highFive;
        private boolean isUnique(int[] n, int target)
            for(int j = 0; j < n.length; j++)
                if(n[j] == target)
                    return false;
            return true;
        private int findIndexInArray(int[] n, int target)
            for(int j = 0; j < n.length; j++)
                if(n[j] == target)
                    return j;
            return -1;
        public static void main(String[] args) throws IOException
            String path = "images/cougar.jpg";
            Object o = HighFive.class.getResource(path);
            BufferedImage image = ImageIO.read(((URL)o).openStream());
            new HighFive().examineColors(image);
    }

  • Help me, How to insert Rectangle which fill color to image picture

    How to insert Rectangle which fill color to image picture and then It is saved file JPG

    > Is it possible to get the data from CSV files.
    Have you tried searching this forum?

  • How to modify Palete Color of  Image

    I have downloaded some football game and i realized that they use 1 image for all team. After that, i decompiled class files and i saw some strange format file. Beside, the image is loaded by byte array (not by Image.createImage("name.png") method). I don't know how they do that. Who can help me

    Here's one way to do it. In this discussion Nokia's proprietary API is used. But on MIDP 2.0 devices you can also use Image.getRGB() and Image.createRGBImage() instead, and on most MIDP 1.0 phones there are proprietary equivalents. This would be the simpler way to do it, but it won't support vanilla MIDP 1.0 phones. For that you need to manipulate the palette data from the png images (but judgin from your other posts you have already figured that out).
    shmoove

  • Is Aperture displaying images with a modified color temp. or gamma?

    I am brand new to Aperture and after importing some scans from black and white negatives, I notice that the same images when viewed in Preview or Photoshop appear brighter and perhaps cooler (but it is hard to tell with black and white images).
    I am just trying to discover why Aperture displays images a little differently than other applications.
    Thanks in advance.
    D

    the same images when viewed in Preview or Photoshop
    Comparison across applications is meaningful if and only if the image has the selfsame source ICC colour space profile. Begin by checking that the image has an embedded source ICC colour space profile. There are lots of ways, either run one the ColorSync AppleScript that extracts the embedded profile, or open the image in Apple Preview and check Tools > Get Info > Summary: ColorSync Profile, or open the image in the Apple ColorSync Utility, or open the image in Adobe Photoshop (which will describe an image without an embedded source ICC colour space profile as 'Untagged RGB', 'Untagged Gray' or 'Untagged CMYK'). If instead you open an image without an embedded source ICC colour space profile in a series of side-by-side application windows, these applications will assign an assumed source ICC colour space profile and the sources they assign may not be the same. In order to configure a conversion you have to have a source and a destination: no source, no colour managed conversion, so a source has sometimes to be assigned.
    Hope this helps,
    Henrik

  • Set background color or image in Outlook Today view

    Hello,
    I just started using the Outlook Today view in Outlook Data File and find it much easier to digest rather than scrolling through tons of folders for the 5 email accounts I have in it.  However, the massive white background hurts my eyes, especially
    at night.  
    Is it possible to modify the the color of this or add a background image to it?  If changing it modifies other areas of Outlook feel free to add that as I'll try it out.
    I'm using Outlook 2010.
    Thanks!
    Jordan

    Hi Rvp711,
    Follow the given path to change the background color of Microsoft Outlook 2010:
    File >> Options >> Color Scheme (from the User Interface Options section)
    But, by default Outlook provides only three color options for Outlook interface
    *Blue
    *Silver
    *Black
    http://office.microsoft.com/en-in/outlook-help/change-the-outlook-2010-color-scheme-HA102071588.aspx
    http://office.microsoft.com/en-in/outlook-help/remove-or-change-backgrounds-and-stationery-on-replies-and-forwards-HA102546938.aspx
    Note: Improve community discussions by marking the answers helpful.
    Thanks
    Clark Kent

Maybe you are looking for

  • ITunes never opens up on my computer

    I recently got a video iPod(30 GB) and tried installing the software. after installing everything iTunes wont open up. I even tried disabling my anti-virus but still nothing happens. does anyone know what i need to do? customer service hasnt been ver

  • ISE reporting problem

    Hi all, I currently have 3 ISE servers running 1.2.1.198  -  ISE1 - primary admin, secondary monitoring, PSN ISE2 - primary monitoring, secondary admin, PSN ISE3 - PSN only.   A pair of 5508 controllers are located on the same campus as ISE1 and ISE2

  • Poor quality resolution in my movies

    My holiday movies didn't appear on the ATV movies list, so i converted them in iTunes for iPod and the quality is really poor. Any suggestions..? Thanks.

  • Woke up this morning and internet said ...boo

    I normally connect to my hub via an ethernet cable but this morning for no apparent reason I am no longer able to connect. I switched on AirPort and can connect that way ok. I can still see my hub via ethernet and my printer also, but internet access

  • Elements 10 for iPad 2

    Hi. How can I also download purchased Elements 10 on my MacBook Pro also on my iPad 2? Thank you. Francis