Gettin Pixel data from png image

Hi,
Has anyone worked with the byte data returned my the getSnapshot() method of the VideoControl (MMAPI). I believe the default is png( i have tested this on Nokia 3650 and 6600 and on Siemens SX1).
In all the devices that support Nokia UI library i can get the pixel values from the byte data by using the com.nokia.mid.ui library, specifically the DirectGraphics.getPixels() method.
In MIDP 2.0 devices i can do this using the Image.getRGB method.
But what about MIDP 1.0.3 devices that do not have the Nokia library ? i believe that the byte data returned by the camera is of raw png format. I have never done this before and so far my search on the web has not been fruitful.
Can anyone point me to information abt the raw png Image (number of bytes of header ... etc) so that i can write my own code to extract the information or better yet point me to the code that does this.

http://www.wotsit.org/
shmoove

Similar Messages

  • Convert colour images to grayscale images & get pixel data from them

    Is the code below correct to convert colour images to grayscale images in Java?
    public void convertToGrayscale (String sourceName,String destName) throws Exception {
    JPEGImageDecoder decoder=JPEGCodec.createJPEGDecoder(new FileInputStream(sourceName));
    JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(new FileOutputStream(destName));
    BufferedImage sourceImg=decoder.decodeAsBufferedImage();
    BufferedImageOp op =new ColorConvertOp(
              ColorSpace.getInstance(ColorSpace.CS_GRAY),null);
         BufferedImage destImg = op.filter(sourceImg,null);
    encoder.encode(destImg);
    decoder = null;
    encoder = null;
    When I get grayscale images from the code below, I would like to access the pixels of those images. So I tried to do:
    byte[] dd=((DataBufferByte)mImage.getRaster().getDataBuffer()).getData();
    BUT the data result array is not 0-255. Could anyone suggest how to obtain pixel data from grayscale images?
    In case that my code shown is not correct or suitable, please give your advice. What I would like to do are in the steps as follows:
    1 change 100*70 jpeg-images to 100*70 grayscale images.
    2 create two dimensional array of pixel data (example [100][70]) from converted images. The number in the array should be between 0-255, right??? And 0 refers to black colour and 255 refers to white colour???
    I am confused about grayscale images. Please help.
    Thank you so much

    I am not sure i understand what is the problem exactly.
    Structure of DataBuffer is described by SampleModel used by same Raster
    object. E.g. it might be 1 byte per xipex or 4 bytes per pixel.
    In your example convertToGrayscale saves images to file as JPEG and
    it seems you later read it back. It is possible what image you read back
    is not greyscale but ARGB and data buffer has different format.
    Technically, if you just need level of grey you may simply
    call getRGB on your output image. Grey is uniform mix of R, G and B.
    Also, instead of ColorConverOp you may dimply create output image of
    grayscale type and draw your color input image with drawImage().
    If none of these helps please try to provide more details.

  • Extracting data from an image (Java Steganography)

    Hey all!
    I am writing an application in Java that hides bytes in an images pixel's Least Significant Bits.
    Here is the embeding function (mind you, its at an early stage). As far as I can tell, it works perfectly...
         public BufferedImage LSB_BufferedImageEmbed(BufferedImage image, byte[] data)
              int imgWidth = image.getWidth(null);
              int imgHeight = image.getHeight(null);
              //preformat the data array and return as an array of ints?
              int[] formated_data = FormatDataArray(data);
              int index = 0;
              try
                   for(int i = 0; i < imgHeight; i++)
                        for(int j = 0; j < imgWidth; j++)
                             if(index == formated_data.length)
                                  break;
                             System.out.print("Pixel prior Embed: " + image.getRGB(j, i) + "\n");
                             int current_pixel = image.getRGB(j, i);
                             int current_data = formated_data[index++];
                             //Perform bitwise AND on current pixel value - isolating the Least Significant bits.
                             //NB: Mask is = ff fc fc fc [Alpha Byte] [Red] [Green] [Blue]
                             //1111 1111 - 1111 1100 - 1111 1100 - 1111 1100
                             current_pixel &= 0xfffcfcfc;
                             //x << y is "shift x right by y spaces"
                             //Add bits 5,4 of current data to the bottom of the red channel - xx -- xx xx
                             current_pixel = current_pixel + ((current_data & 0x30) << 12);
                             //Add bits 3,2 of current data to the bottom of the green channel - xx xx -- xx
                             current_pixel = current_pixel + ((current_data & 0x0c) << 6);
                             //Add bits 1,0 of current data to the bottom of the blue channel - xx xx xx --
                             current_pixel = current_pixel + (current_data & 0x03);
                             image.setRGB(j, i, current_pixel);
              catch(Exception e)
                   System.out.println("Problem with LSB!!");
              return image;
    And here's the corresponding extraction method
         public byte[] LSB_ExtractFromBufferedImage(BufferedImage image)
              int imgWidth = image.getWidth(null);
              int imgHeight = image.getHeight(null);
              int index = 0;
              byte[] extracted_bytes;
              byte[] extracted_data = new byte[12];
              try
                   for (int i = 0; i < imgHeight; i++)
                        for (int j = 0; j < imgWidth; j++)
                             if(index == extracted_data.length)
                                  break;
                             System.out.print("Pixel prior Extract: " + image.getRGB(j, i) + "\n");
                             int current_pixel = image.getRGB(j, i);
                             //Isolate the bit pattern needed for the Int to byte[] method...
                             current_pixel &= 0x00030303;
                             extracted_bytes = IntToByteArray(current_pixel);
                             for(int t = 0; t < 4; t++)
                                  extracted_data[index++] = extracted_bytes[t];
              catch(Exception e)
                   System.out.println("Problem with LSB Extraction!!");
              return extracted_data;
    Unfortunately, this doesn't work all that well (by that, I mean not working at all!) It does return the bits alright, but not the ones that were previosuly embedded. Does anyone have any ideas on any aspect of these methods as to why that shouldn't work??
    Any help is greatly appreciated!
    Cougaris

    Are you sure that you interpret your results correctly ?
    Your routines use different data representations and that leads easily to misinterpretation.
    Especially as you only use 6 Bits from an int but take 4 Bytes as result.
    Post some input and output data. i.e. an array of 3 values for formattedData and the 12 resulting bytes. I expect the data to be correct (relative to your code, probably not to your intentions).
    Regards
    SH

  • How to extract 64 bit data from imaq image using IMAQ Extract VI

    I have LV 8.5.1, Vision 8.5 and need to extract 64 bit data from a 64 bit image and I get the "invalid image" error while using the IMAQ Extract VI.  What version of Vision do I need to allow me to do this? 
    Currently, the work-around I have...
    1) convert the image to 32bit
    2) use the ROI tools I to get the rectangle data I need
    3) then go back to the original image and the convert the image to a 64 bit array
    4) take the rectangle data to extract the data needed out of the 64 bit array data.
    klunky but it works.  I would think that the IMAQ Extract tool should allow me to extract the 64 bit data but it doesnt... forces me to 32 bit.
    suggestions?

    steve05ram360 wrote:
    awesome, that does work. 
    Attached DLL slightly corrected and should be OK also "in place" when Dst is not connected like original IMAQ function. Hopefully it works properly now. By the way all IMAQ types are supported, not only U64.
    Andrey.
    Attachments:
    ADVExtractDLL.zip ‏9 KB

  • How to retrieve data from Silicon Image striped disks on NVRAID?

    Hello,
    I used to have MSI K8N Diamond motherboard and had to claim it. They returned to
    me MSI K8N SLI Platinum saying they couldn't get K8n Diamond anymore. However, K8N SLI Platinum doesn't have a Silicon Image 3132 RAID Controller I had used for my striped disks, so I'm trying to use NVRAID. NVRAID config says RAID status is OK (healthy),
    but I cannot see any data on the RAID disk in Windows XP (it says the disk is not formatted). Can anybody help me with this problem? If the two RAIDs (Silicon X NVRAID) use different formats for writing data onto disks, is there any utility I could use to retreive my unavailable data from the disks, that used to be in Silicon Image RIAD?
    Thank you very much for your time.

    This is the problem with 2 threads that don't get merged, someone needs to merge these. 
    https://forum-en.msi.com/index.php?topic=100574.0
    Since this seems to be the more popular of the 2 I will repost below what I said in the other thread.  Personally I would try the destriper before attempting what Hans suggest as it is destuctive(not saying it won't work just saying it will write metadata to the drives, and any writing at this point can have bad consequences). 
    Quote
    So the NVRAID see the 2 drives as a striped set?  This is suprising.  You could try to run a data recovery tool like getdataback and see if it sees anything on this new NVRAID array.  But other then that your only chance to recover without using the above suggestion(get access to another SiImage which is probably the easiest)
    is try a software destriper.  Here is an example: http://www.runtime.org/raid.htm
    The destripers are only as good as their authors write them, they have to know where for example where SiImage puts the metadata, it sounds like this software will try all combinations it knows(non-destructive),but can possibly recover data in your situation.  You may even have to use a data recovery tool after the destriping depending on where you are at now.
    Whatever you do, don't go configuring anything as any writing to the disk could make data hard if not impossible to get back.
    I think it's easier to get another controller but in theory a de-striper will do it.  Good luck I'm curious to see how things work out. 

  • Quickly extract GPS positioning data from an Image?

    Hi --
    Is there any way to quickly extract the GPS positioning data (lat, long) for a Image in Aperture -- or, equivalently, open a Google Maps page in a Web browser showing the location?
    I tried:
    - every menu related to Places I could find
    - copying the info in the lat and long fields (can't be selected)
    - copying the info from the Lift & Stamp HUD (also can't be selected).
    I'm sure I'm missing something obvious. 
    Thanks.

    Hi Kirby,
    maybe one of my Automator Actions can help, until you have abetter solution:
    http://dreschler-fischer.de/scripts/PrintFullImageInfo.workflow.zip
    This workflow needs to be installed in your user library, "Services" folder and will write selected metadata tags to a textfile.
    To use it,
    select the images in Aperture's browser,
    Use Aperture > Services > PrintFullImageInfo
    When the service runs, it will prompt for the name of a textfile.
    Regards
    Léonie
    You should find something similar to this in the textfile:
    Version Name: P1040669
       Dimensions: 1920x2560
       Image Date: Monday, 6 March 2006Monday 2:10:58 PM
       Keywords: geocoded, iPhoto Original
       Rating: 0, flagged: false, picked: true
       Camera make: Panasonic, camera model: DMC-FZ5
       Focal Length: 11.0mm, Aperture: f/ 5.6, Shutter Speed: 0.0025s
    GPS: Longitude: -78.175, Latitude: 0.0, Altitude: unknown

  • Reading all the Exif data from TIFF Image

    Hi!
    I am trying to get Exif information out of an image. I succeeded partly because I get The Baseline (EXIF IFD0) and EXIF Sub IFD, but not the rest (The Maker Note, EXIF Interoperability IFD and IFD1). Can anyone tell me what I could try to get all the data out. Any help is appiciated
    URL url = new URL(paramName);
    ImageInputStream stream = ImageIO.createImageInputStream(url.openStream());
            Iterator iter = ImageIO.getImageReaders(stream);
            ImageReader reader = (ImageReader) iter.next();
            reader.setInput(stream);
            BufferedImage image = reader.read(0);
            IIOMetadata metadata = reader.getImageMetadata(0);
            org.w3c.dom.Node metadataRoot = metadata.getAsTree(metadata.getNativeMetadataFormatName());
            DOMSource doc = new DOMSource(metadataRoot);
            return doc;

    There is a separate one for Firefox, but it appears to only be compatible with Firefox versions 0.7-3.0.x, so Opanda has not made it compatible with Firefox 3.5.x and 3.6.x versions, I suppose:
    http://www.opanda.com/en/download/
    See this and the link in that post for a possible solution: http://forums.steves-digicams.com/1048665-post6.html

  • I cannot remove embedded barcode from the image. Due to saving compression.

    Hi guys,
    I recreate a thread to prevent confusing on my previous one. Please only reply to this thread thanks.
    Ok, for a start I will give some general description about the application I made.
    I had some problem with the image being compressed while it is saved.
    Because saving an image will cause it to compress and had its pixel valued changed, I could not successfully remove the bardcode that is embedded inside a image(although some of the pixel value will be returned to original normally). I had placed my code below and will accept any opinion that will help me solve the removal of barcode problem.
    What my application does is actually very simple. It will take the pixel value of the area inside the image that will be embed with the barcode first, then it will take the pixel value of the barcode and use the formula (1-alpha * Image pixel value) + (alpha * barcode pixel value) = new pixel value which will contain the barcode that had been embedded inside. The formula works great but when I saved the image the pixel value will change due to compression. On the removal of barcode my application will read every pixel value from the image embedded with barcode (only the area with barcode embedded), then it will go on to read every pixel value of the barcode used for embedding and then use the formula (Embedded image pixel value - (alpha * Barcode pixel value) - (1 - alpha) = original pixel value. But due to the reason that compression will change some of the pixel inside the saved image to drop in its value, the result from the removal formula will be negative and hence caused my result image to become wierd as it will red colors instead of original color on some of its pixel. I tried saving under PNG format which people said to be lossless compression but the result is still the same.
    So I need to ask you guys for opinion or help me find the part where I actually did wrongly and caused the image pixel value to change.
    Thanks. Please proceed and read below for the codes that I used. It is messy and I will sort it out later.
    When alpha is set as 1 the barcode will appear to be overwrite onto the image. But when alpha is set as 0.1 the barcode will appear to be transparent and almost seems to be not there on the image when embedded.
    This is the code I used to retrieve image pixel when embedding:
    public static int[] getImagePixelValue(BufferedImage image, int x, int y){
              //Create an array to store image RGB value
              int[] imageRGB = new int[3];
              //Get height and width from input image
              int imageWidth = image.getWidth();
              int imageHeight = image.getHeight();
              //Get raw RGB value from image
              int imageValue = image.getRGB(x, y);
              //Convert image raw RGB value
              int imageRed = ((image.getRGB(x, y) >> 16) & 0xff);
              int imageGreen = ((image.getRGB(x, y) >> 8) & 0xff);
              int imageBlue = image.getRGB(x, y) & 0xff;
              //Input the converted RGB value into the array
              imageRGB[0] = imageRed;
              imageRGB[1] = imageGreen;
              imageRGB[2] = imageBlue;
              /*//Print out the pixel value to check
              System.out.println("Image red pixel: "+imageRGB[0]);
              System.out.println("Image green pixel: "+imageRGB[1]);
              System.out.println("Image blue pixel: "+imageRGB[2]);*/
              //Return image RGB value
              return imageRGB;
    }This is the code I used to retrieve barcode pixel for embedding:
    public static int[] getWatermarkPixelValue(BufferedImage watermark, int x, int y){
              //Create an array to store watermark RGB value
              int[] watermarkRGB = new int[3];
              //Get height and width from input watermark
              int watermarkWidth = watermark.getWidth();
              int watermarkHeight = watermark.getHeight();
              int watermarkValue = watermark.getRGB(x, y);
              //Convert watermark raw RGB value
              int watermarkRed = ((watermark.getRGB(x, y) >> 16) & 0xff);
              int watermarkGreen = ((watermark.getRGB(x, y) >> 8) & 0xff);
              int watermarkBlue = watermark.getRGB(x, y) & 0xff;
              //Input the converted RGB value into the array
              watermarkRGB[0] = watermarkRed;
              watermarkRGB[1] = watermarkGreen;
              watermarkRGB[2] = watermarkBlue;
              /*//Print out the pixel value to check
              System.out.println("Watermark red pixel: "+watermarkRGB[0]);
              System.out.println("Watermark green pixel: "+watermarkRGB[1]);
              System.out.println("Watermark blue pixel: "+watermarkRGB[2]);*/
              //Return watermark RGB value
              return watermarkRGB;
         }This is the code I used for merging the image pixel and barcode pixel to get the embedded pixel value:
    public static int[] getEmbeddedPixelValue(int[] imagePixelValue, int[] watermarkPixelValue, double alpha){
              //Create a object to hold embedded pixel value
              int[] embeddedRGBValue = new int[3];
              //Change image pixel value into double calculating equation
              double imgRedValue = (double) imagePixelValue[0];
              double imgGreenValue = (double) imagePixelValue[1];
              double imgBlueValue = (double) imagePixelValue[2];
              //Change watermark pixel value into double calculating equation
              double wmRedValue = (double) watermarkPixelValue[0];
              double wmGreenValue = (double) watermarkPixelValue[1];
              double wmBlueValue = (double) watermarkPixelValue[2];
              //Equation for embedding image and watermark together
              double embeddedRed = ((1.0 - alpha) * imgRedValue) + (alpha * wmRedValue);
              double embeddedGreen = ((1.0 - alpha) * imgGreenValue) + (alpha * wmGreenValue);
              double embeddedBlue = ((1.0 - alpha) * imgBlueValue) + (alpha * wmBlueValue);
              //Changing embedded value from double to int
              int embeddedRedValue = (int) embeddedRed;
              int embeddedGreenValue = (int) embeddedGreen;
              int embeddedBlueValue = (int) embeddedBlue;
              //input the embedded RGB value into the array
              embeddedRGBValue[0] = embeddedRedValue;
              embeddedRGBValue[1] = embeddedGreenValue;
              embeddedRGBValue[2] = embeddedBlueValue;
              //Return embedded pixel value
              return embeddedRGBValue;
         }This is the code where I used for the embedding process:
    else if(target == embedButton){
                   String xCoordinate = JOptionPane.showInputDialog(embedButton, "Enter coordinate X", "When you want to embed the watermark?", JOptionPane.QUESTION_MESSAGE);
                   String yCoordinate = JOptionPane.showInputDialog(embedButton, "Enter coordinate Y", "When you want to embed the watermark?", JOptionPane.QUESTION_MESSAGE);
                   int xValue = Integer.parseInt(xCoordinate);
                   int yValue = Integer.parseInt(yCoordinate);
                   int wCounter = 0;
                   int hCounter = 0;
                   //Create file object to be used in embedding and removing watermark
                   File inputImage = new File(imagePath);
                   File inputWatermark = new File(watermarkPath);
                   //Convert string into double for calculation of embedded pixel value
                   try {
                        alphaDouble = Double.valueOf(alphaValue).doubleValue();
                   catch (NumberFormatException nfe) {
                        System.out.println("NumberFormatException: " + nfe.getMessage());
                   try{
                        //Define selected image as testPic and make java read the file selected
                        BufferedImage image= ImageIO.read(inputImage);
                        BufferedImage watermark= ImageIO.read(inputWatermark);
                        BufferedImage testing;
                        //Get height and width value from the selected image
                        int imageWidth = image.getWidth();
                        int imageHeight = image.getHeight();
                        //Get height and width value from the selected barcode
                        int watermarkWidth = watermark.getWidth();
                        int watermarkHeight = watermark.getHeight();
                        int totalWidth = watermarkWidth + xValue;
                        int totalHeight = watermarkHeight + yValue;
                        //Use nested for loop to get RGB value from every pixel that the barcode will be embedded in the selected image
                        if(totalWidth <= imageWidth && totalHeight <= imageHeight){
                             for (int h = yValue ; h < totalHeight; h++){
                                  for (int w = xValue; w < totalWidth; w++){
                                       int[] imagePixelValue = getImagePixelValue(image, w, h);
                                       int[] watermarkPixelValue = getWatermarkPixelValue(watermark, wCounter, hCounter);
                                       int[] embeddedPixelRGBValue = getEmbeddedPixelValue(imagePixelValue, watermarkPixelValue, alphaDouble);
                                       setRed(image, w, h, embeddedPixelRGBValue[0]);
                                       setGreen(image, w, h, embeddedPixelRGBValue[1]);
                                       setBlue(image, w, h, embeddedPixelRGBValue[2]);
                                       wCounter++;
                                       if(wCounter == watermarkWidth){
                                            wCounter = 0;
                                            hCounter++;
                        else{
                             JOptionPane.showMessageDialog(embedButton, "The watermark cannot be embedded at the coordinates.");
                        tempImage = image;
                        imageIcon = new ImageIcon(tempImage);
                        labelImage.setIcon(imageIcon);
                        imagePanel.add(labelImage);
                        container.add(imagePanel, BorderLayout.CENTER);
                        setVisible(true);
                        System.out.println("Embedding completed");
                   catch(Exception errorEmbedding){
                        //If there is any error, the try and catch function will tell you the error
                        System.out.println("The following error occured: "+errorEmbedding);
              }This is the code I use to save the image that had been embedded with the barcode:
    else if(target == saveAction){
                   JFileChooser chooser = new JFileChooser();
                   FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG & GIF Images", "jpg", "gif");
                   chooser.setFileFilter(filter);
                   chooser.setCurrentDirectory(new File("."));
                   int returnVal = chooser.showSaveDialog(getParent());
                   if(returnVal == JFileChooser.APPROVE_OPTION) {
                        String name = chooser.getSelectedFile().getAbsolutePath();
                        //Create a string instant to hold outputImage path name
                        String saveFile = chooser.getSelectedFile().getName()+"."+fileType;
                        //Create file output to decide what name will be used to save the file
                        File outputImage = new File(saveFile);
                        try{
                             //Save the file with the name used
                             ImageIO.write((RenderedImage) tempImage,fileType,outputImage);
                        catch(Exception errorSaving){
                             //If there is any error, the try and catch function will tell you the error
                             System.out.println("The following error occured: "+errorSaving);
                   else{
              }This is the code I used for removal process of barcode:
    else if(target == removeButton){
                   //Create file object to be used in embedding and removing watermark
                   File inputImage = new File("removalTesting.jpg");
                   //File inputWatermark = new File(watermarkPath);
                   //Used a defined barcode for testing of removing barcode from embedded image
                   File inputWatermark = new File("barcode.jpg");
                   /*//Convert string into double for calculation of embedded pixel value
                   try {
                        alphaDouble = Double.valueOf(alphaValue).doubleValue();
                   catch (NumberFormatException nfe) {
                        System.out.println("NumberFormatException: " + nfe.getMessage());
                   //Used a defined alpha value for testing of removing barcode from embedded image
                   //alphaDouble = 0.5;
                   //Create x and y value for the starting coordinates of barcode embedded in the embedded image
                   int xValue = 0;
                   int yValue = 0;
                   int wCounter = 0;
                   int hCounter = 0;
                   try{
                        //Define selected image as testPic and make java read the file selected
                        BufferedImage image= ImageIO.read(inputImage);
                        BufferedImage watermark= ImageIO.read(inputWatermark);
                        //Get height and width value from the selected image
                        int imageWidth = image.getWidth();
                        int imageHeight = image.getHeight();
                        //Get height and width value from the selected barcode
                        int watermarkWidth = watermark.getWidth();
                        int watermarkHeight = watermark.getHeight();
                        int totalWidth = watermarkWidth + xValue;
                        int totalHeight = watermarkHeight + yValue;
                        //Use nested for loop to get RGB value from every pixel that the barcode had been embedded in the embedded image
                        if(totalWidth <= imageWidth && totalHeight <= imageHeight){
                             for (int h = yValue ; h < totalHeight; h++){
                                  for (int w = xValue; w < totalWidth; w++){
                                       int[] imagePixelValue = getImagePixelValue(image, w, h);
                                       int[] watermarkPixelValue = getWatermarkPixelValue(watermark, wCounter, hCounter);
                                       int[] removedPixelRGBValue = getOriginalImagePixelValue(imagePixelValue, watermarkPixelValue, alphaDouble);
                                       setRed(image, w, h, removedPixelRGBValue[0]);
                                       setGreen(image, w, h, removedPixelRGBValue[1]);
                                       setBlue(image, w, h, removedPixelRGBValue[2]);
                                       wCounter++;
                                       if(wCounter == watermarkWidth){
                                            wCounter = 0;
                                            hCounter++;
                        tempImage = image;
                        imageIcon = new ImageIcon(tempImage);
                        labelImage.setIcon(imageIcon);
                        imagePanel.add(labelImage);
                        container.add(imagePanel, BorderLayout.CENTER);
                        setVisible(true);
                        System.out.println("Embedding completed");
                   catch(Exception errorEmbedding){
                        //If there is any error, the try and catch function will tell you the error
                        System.out.println("The following error occured: "+errorEmbedding);
              }Sorry if the codes are in a mess, I did not had the time to sort it out yet but most likely do it when I got the removal of barcode done.
    Follow this link to have a look of the result I see in my application when I got the barcode embedded into the image I selected:
    [http://img356.imageshack.us/my.php?image=beforeremovalresultmg2.jpg]
    Follow this link to have a look of the result I see in my application after I got the barcode removed:
    [http://img523.imageshack.us/my.php?image=removalresultmx4.jpg]
    As you can see from the link, after I remove the barcode from the image. Some of the pixel actually went back to normal in the barcode area when the the barcode is embedded into the image. But some pixel in the barcode area had its value changed due to compression when I save the image file I think.
    Anyone can help me find out the problem?
    Thanks.

    KamenRider wrote:
    I suspect the problem lies in the code when I save the image. Because people said that PNG was loseless compression but when I saved in PNG some of the pixel went back to normal while some did not. This is obviously the cause from changing of pixel value when I saved the image.You are almost certainly wrong. This is trivially easy to check. Print out the color of a certain pixel immediately before you save it. Open the saved PNG in your favorite image manipulation program and check the saved value of that same pixel. When you re-load the saved PNG, print out the color again. It should be unchanged.
    Thanks you for trying to help me spot the problem but the formula is correct. The alpha value i used in my application is used to set the transparency of the barcode that will be embedded in the image. Hence, when alpha = 1 the new pixel value should be the barcode value. ^^The formula isn't wrong, it's just not doing what you think it's doing. Remember that you're working with ints here, not floating point numbers, so they have finite precision. When you case from double to int, fractions are dropped. As morgalr pointed out, your formula is:
    (1-alpha * Image pixel value) + (alpha * barcode pixel value) = new pixel value You didn't show us the code for getOriginalImagePixelValue but I imagine it's:
    original pixel value = (new pixel value - alpha * barcode pixel value) / (1 - alpha)On a piece of paper, take alpha = 0.9, image pixel = 17 and barcode pixel = 100. Calculate out what you should get for new pixel value and then calculate what you should get for original pixel value. You will find they don't match.

  • How to get pixel data in the format I want

    I'm writing a format plug-in and am having some difficulty getting the pixel data from photoshop in the format I want. From what I gather from the documentation in the SDK I need to specify the following to tell photoshop what format to deliver my pixels in:
    theRect
    loPlane
    hiPlane
    data
    colBytes
    rowBytes
    planeBytes
    planeMap
    I specify all of these appropriately for a 32 bit rgba8888 uncompresssed image and it works just fine... but ONLY if the image I load in the first place matches the format I am requesting. If the image I load is some other format, like a 256 color image with a palette, gFormatRecord->advanceState() just fails with a nebulous -30500 error code (formatBadParameters) instead of delivering pixel data.
    So my big question is this: Is Photoshop capable of doing the conversion and delivering the pixels to my format plug-in in my requested format? If it CAN do it, what might I be doing wrong? Please help! Thanks!!

    You noticed you can use the planeMap[] array to permute the channels. It's not so obvious that Photoshop should offer generalised bit depth/colour space/palette processing. It can be argued that's the role of the plugin itself: to mediate between Photoshop's native image data (which it does offer conveniently) and whatever arbitrary image format the user requires. At least, that's what most of
    my plugins do.
    Sure, there are a few obvious conversions, but you have to stop somewhere... Sooner or later you'll be implementing stuff on the Photoshop side that
    should be in a plugin. I don't have a big problem with the line drawn in the current API.

  • How to get the pixel data so as to work on it?

    Hi all,
    I am trying to write a plug-in that will crop and scale the image, edit the selection in the image document based on image data. For this purpose I need the pixel data of the image. How to get the image data as different pixels and what is the data structure used to store this data?
    Assumption: No layers i.e., only background
    Thanks in advance,
    Sailu

    Hi Ilya,
    Thank you for your post. In the plugin architecture you propose (automation + filter), do you have an idea about how to share the pixel data between the two plugins? I have found a post that gives details about how to get pixel data and show it using ADM components
    Matthew Hollingworth, "ADM Color Managed Preview?" #1, 22 Oct 2007 11:53 pm but it supposes that you have a filter plug-in.
    Again, does anyone knows how to preview the current image in a AUTOMATION plug in? This seems impossible.
    Thank you all for your help
    Cheers,
    Chaker

  • Black background for transparent PNG images - Xcelsius 2008 SP4

    Hi Experts,
    I am using Xcelsius 2008 SP4. I have used Image component to show a PNG image with transparent background. When I export the flash, the image is being shown with a black background.
    In Xcelsius 2008 SP3, this problem was not there. I am facing this issue after installing SP4.
    Did anyone else face similar issue ? Is there any workaround ?
    regards,
    pasg

    Hi all,
    I was facing the very same issue. I succeeded in finding a solution to it. This is happening coz of the dimension and pixels of the .png image. I imported the image in the image component, which had the dimensions, 175 x 70, and was of 9.26 kb and the black background was visible. I then changed the dimension of the image to 428 x 140, and 19.2 kb (double the size), and VOILA!! to my surprise IT WORKED !
    Don’t forget to “check” the “embed file” and  “Hide SWF Background Color” check boxes in the image component's, general tab.
    Try the same, I hope this helps.
    Regards,
    Sara

  • Removing all the hidden data from photos

    If I export a photo to share, I often want to remove all the extra hidden stored data such as date taken exposures etc. Is this easy?
    Rod

    Hi rod,
    By accident I found that a little app I use (ImageWell) to add connotations and text to my screenshots also strips most if not all the EXIF data from an image that you drag out of the Image well.
    I just checked it out again. I dragged an image into the well, changed the name of the image and dragged it out. The EXIF data was gone when I opened it with Preview and did Tools/Get info.
    ImageWell

  • Data from my old sync account (the one used on firefox 28) got replaced by data from my new sync account (the one used on firefox 34)

    Disaster step by step:
    1. Run old Firefox 28, using a separate profile named "Firefox 28", and log in to my old sync account (the one used on Firefox 28). In the old sync account i have saved tons of useful bookmarks and data. Got a device name "Admin's Firefox on HP-Laptop".
    2. Check all my old bookmarks and they are fine. Stupid of me i didn't make a backup at that point.
    3. Run new Firefox 34.0.5, using a separate profile named "default", and log in to my new sync account (the one used on Firefox 29 and on). In the new sync account i have saved a few bookmarks only. Got a device name "Admin's Firefox on HP-Laptop" again. Stupid of me i didn't pick another name. Didn't imagine what was about to happen.
    4. What happened: All of my precious data which was stored on the old sync account got replaced by the few bookmarks of the new sync account. And by replaced i mean replaced ON THE SYNC SERVER. Now the old sync server has the very little data of the new sync account and i have lost all my precious data!!!
    That little bug of Firefox cost me all of my data on the server.
    People, please help me find a solution to recover my data that was stored on the old sync server and got replaced. I have no backup of the lost bookmarks nor backup of a profile that contains them.
    P.S.: I used the default setting to sync, which was to merge data.
    P.S.2: I don't maintain a personal old Firefox Sync server.
    Who is the administrator of the old sync server maintained by Mozilla? Does he keep image backup? Maybe he could extract my data from an image backup. A pre-today date would be fine!

    Hi,
    Unfortunately Sync does not backup. However in Windows 7 you can right click on the profile folder and select to restore to a previous version.
    I hope this helps, and I am very sorry about the lost data.

  • Captivate 5 - Inserted PNG images from Fireworks are pixelated

    The PNG images I inserted from Fireworks are showing up pixelated when I play the file in a browser, but look fine while I'm working in Captivate.  Any thoughts?
    THANKS!
    Birgit

    Hello,
    Did you try changing the publish quality? Because of the fact that CP when converting to SWF will still be doing some compression, I really would give that first of all a try.
    PNG allows even partial transparency, and certainly its 24-bit version. That is one of the reasons that it is superior to JPEG (no transparency) and GIF (only 100% transparency).  But I'm not really used to Fireworks, always using Photoshop for graphical assets.
    Lilybiri

  • I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from

    I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from it.  It has worked in the past but I downloaded the update today and photomerge will not work correctly.  Any ideas?

    hedger,
    How do you expect anyone to help when we don't know a darned thing about the file, abut your setup, exact version of Photoshop and your OS, machine specs, etc.?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

Maybe you are looking for

  • Inspiron 15 (3521) wireless 'limited'...but only at certain places!

    I've spent days trying to resolve this issue on this laptop. I purchased it as a Christmas gift for my son, only to find that it's got a problem with wifi connectivity. What's crazy though is that it connects perfectly to my home router, and will con

  • Burn won't even start

    hi - i'm trying to burn my project, but whenever i click the "burn" button, it just says "formatting finished" and won't do anything else. i don't even have a disc in the drive! this is the first project i've tried to burn on my new macbook pro - whi

  • Color change after exporting from Lightroom

    I noticed a drastic color change after exporting a file from Lightroom to a JPEG file today. I have been using Lightroom for a while, and it never happened before. I am assuming that I changed the setting somehow and I cannot find how to fix it. Here

  • IFolder 3.8 dirsync created orphaned users

    Had an incident where around 50 of 70 users were deleted from an ifolder slave. The ifolders they had were then orphaned. The next day the users were synced back into ifolder, but the folders had to be associated manually. Any ideas on why this would

  • PS EL 2.0 アップデート中にフリーズします.

    今までOS X JaguarでPhotoshop Elements 2.0を使っていましたが.最近パソコンを買い替えたためOS X Tigerがインストールされたパワーブックを使うようになりました. その折.Elements 2.0をインストールしたところ.Adobe Onlineにアクセスしてアップデートしようとする度に.フリーズします. 見たところ.AWEXFiles.textというファイルをダウンロードするまではスムーズに行くのですが.AWEDBFiles4.aweというファイルをダウンロ