Preview changes RGB values when resizing images

Since I upgraded to snow leopard, preview increases the Red spectrum when resizing images (png). Is this a bug or do I need to change a setting to preserve the original RGB values?

Figured it out. It seems that when you don't specify the BufferedImage that the operation will write too it changes the type to something it uses for the operation. This still seems like it should be a bug to me, but i got around it by doing this:
BufferedImage tempIMG = new BufferedImage((int)(srcImg.getWidth()*scale),(int)(srcImg.getHeight()*scale),srcImg.getType());
op.filter(srcImg, tempIMG);
return tempIMG.

Similar Messages

  • Changing UISlider value when tapped

    In SDK 2.0 UISlider value can be changed by dragging the thumb image or by tapping on the slider control, however in SDK 3.0 slider value only changes by dragging the thumb image.
    I have checked UICatalogue example also, the slider values changes on tapping in SDK 2.0 but not in SDK 3.0.
    How can I change the value of slider when tapped on certain location on the slider in SDK 3.0 i.e. similar to the UISlider behavior in SDK 2.0

    m-awais wrote:
    In SDK 2.0 UISlider value can be changed by dragging the thumb image or by tapping on the slider control, however in SDK 3.0 slider value only changes by dragging the thumb image.
    Thanks for pointing that out! If it was documented anywhere I sure didn't notice it.
    How can I change the value of slider when tapped on certain location on the slider in SDK 3.0 i.e. similar to the UISlider behavior in SDK 2.0
    Firstly, check and see if the touch events you want are passed to the super view or its controller. If not, you'll need to subclass UISlider and catch all its touch events. In that case, just be sure to pass all the touches to the super class and you should be ok. I think I'm going to have to do this in one of my apps too, so please let us know if there are any gotchas.
    \- Ray

  • How to find RGB values of an image in MIDP 2.0?

    I am builiding a midlet in which i m supposed to take an image and than i want to find RGB values of all pixels
    .After Finding the RGB values i want to store them in an array,and sort that array to find 5 Most repeated element of that array.Also i wanna construct color from those 5 Values and Display Those Colors.Can Anyone
    Guide me Through This?

    I have not used Vision much but I would be very surprised if you would be able to do this directly.  It should be straight forward to get an average intensity with or without Vision (convert image to 2D matrix and average the values, for instance) -- the difficulty will be correlating the calculated values back to Lumens, etc. This could likely be done but it would probably require you to come up with the calibration curve and would be sensitive to setup changes, dust on the lens, equipment aging, etc. and these things should not be discounted.  This is why, particularly if  you're in a production environment, you'd probably better off buying a commercial meter and talking to it via a driver than to try to do it yourself -- they've already taken these things into account. 
    One more thing, in the picture you attached, any luminosity calculations you made would probably be skewed low as the white is saturated (railed) in spots and those under-reported values would affect your average.  If you did try to come up with a Lumen calculation, you would probably want to turn your aperature and/or exposure down before creating the calibration curve.

  • "process mutiple files" freezes computer when resizing images.PSE3

    This function has always worked perfectly for me for years. It started about 2 weeks ago and I have no clue why it is doing this.
    Whenever I try to resize a folder containing mutiple or even single images, it freezes the program and computer until I restart everything.
    More specifics;
    files are being downsized not upsized.
    the original image loads into the program, then as it is being resized, it freezes up at the same point each time. This is when the "progress bar" (not sure of exact name) at the bottom of the page shows about 25% progress.
    I have cleaned up the hard drive and done a file reorganization.
    I have uninstalled and reinstalled the program.
    I can resize images directly through the image/resize function one at a time. The problem is that I frequently have to resize large batches of images.
    Thanks for any help.
    Dave

    Dave
    This has caught other people. Check you Resize Image box to see if some strange value has been entered. One user had accidentally entered 4 pixels instead of 4 inches so all his pictures came out really small. I wonder if you have the opposite problem and are resaving to some extremely large size that Elements does not like.
    If not post back.
    Additional question-are you having problems with the same set of pictures? If so, could you run a test on a second set of pictures. Perhaps there is something strange in the source files.

  • RGB values when scaling

    Hello,
    My problem is - I have an image displayed on a label
    JLabel label = new JLabel(new ImageIcon(shapeIcon));
    And I am retrieving the pixel value through a mouse event
    int positionX = mouseEvent.getX();
    int positionY = mouseEvent.getY();
    int pixelSource = bufferedShape.getRGB(positionX, positionY);
    This works fine until I scale the image as follows on the display
    JLabel label = new JLabel(new ImageIcon(shapeIcon.getScaledInstance(200, 200, 0)));
    Now when I click on the image I get an error thrown at this line
    int pixelSource = bufferedShape.getRGB(positionX, positionY);
    Any ideas.
    Thanks,
    Enda

    OK sorry.
    Here is the part of the UI code
    public void displayShape()
    //Image location
    buildConstraints(constraints,0,0,1,0,100,100);
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.insets = new Insets(6,6,6,6);
    JLabel label = new JLabel(new ImageIcon(shapeIcon.getScaledInstance(200, 200, 0)));
    // label.setIcon(new ImageIcon(shapeIcon));
    lm.setConstraints(label, constraints);
    pane.add(label);
    And here is the Mouse listener
    class LabelMouseListener extends MouseAdapter
    public void mouseClicked(MouseEvent mouseEvent)
    //Get the X and Y position of the Mouse
    int positionX = mouseEvent.getX();
    int positionY = mouseEvent.getY();
    //Get the RGB value of the pixel at x,y on the BufferedImage
    int pixelSource = bufferedShape.getRGB(positionX, positionY);
    // Create the Color Object
    Color colour = new Color(pixelSource);
    // Get the Red values (only need red value as it is a B & W image)
    int red = colour.getRed();
    if (colour.getRed() == 0)
    label2.setText("Black Pixel value 0 at ("
    positionX ", " positionY ")");
    else
    label2.setText("White Pixel value 255 at ("
    positionX ", " positionY ")");
    And the error
    Exception occurred during event dispatching:
    java.lang.ArrayIndexOutOfBoundsException
         at sun.awt.image.IntegerInterleavedRaster.getDataElements(IntegerInterleavedRaster.java:202)
         at java.awt.image.BufferedImage.getRGB(BufferedImage.java:763)
         at jamesproject.Shape$LabelMouseListener.mouseClicked(Shape.java:542)
         at java.awt.Component.processMouseEvent(Component.java:3718)
         at java.awt.Component.processEvent(Component.java:3544)
         at java.awt.Container.processEvent(Container.java:1164)
         at java.awt.Component.dispatchEventImpl(Component.java:2593)
         at java.awt.Container.dispatchEventImpl(Container.java:1213)
         at java.awt.Component.dispatchEvent(Component.java:2497)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2230)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
         at java.awt.Container.dispatchEventImpl(Container.java:1200)
         at java.awt.Window.dispatchEventImpl(Window.java:914)
         at java.awt.Component.dispatchEvent(Component.java:2497)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    THANKS.
    Enda

  • How change saturation value of a image??

    I have to change value pixel to pixel??
    My image is a PlanarImage and a slider for modificate saturation value.
    Each pixel-> convert HSB-> manipulate S value ->> convert to RGB???
    Thanks.

    Ajay,
    I think you are changing more than one variable value at a time...this things generally happen in this case.
    Go step by step.....
    Press on the pencil button
    value filed becomes editable
    change the value
    and at once press the enter
    the ediatble field automatically becomes non editable, and hence retain the changed value.
    Pooja

  • Change item value when a specific item has changed... how can i do that?

    Hi guys, i need to ask something...
    Is it possible to have a process or a computation, that gives value to an item, only when one specific item has changed.
    I have other items on my page too, but this two are related, and i need to give a specific value to the first one, only when the value of the second has changed...
    Help please
    tsveti:)

    Hey Farhan, i guess i need some help on that easy javascript...
    i havent done much thing with it so i have almost none experience with js....
    So in 'HTML Form Element Attributes' for the second item I m trying this :
    onchange="javascript:{document.getElementById('P1_SUBPROJECT').value = '-1';}"
    but when i change the value of this second item, the first one (P1_SUBPROJECT) dont get -1
    what am i doing wrong?

  • Bitshift when resizing image

    I found the following code on http://developers.sun.com/techtopics/mobility/reference/techart/design_guidelines/image_resizing.html, and it works great for resizing an image.
    In an effort to fully understand what is going on, can someone please explain to me what the bitshift that occurs below do. I understand what happens in a bitshift, but I do not know why the author used a left shift of 16 to establish the ratio for the width and height. Is there something significant about a left shift of 16?
      * This methog resizes an image by resampling its pixels
      * @param src The image to be resized
      * @return The resized image
      private Image resizeImage(Image src) {
          int srcWidth = src.getWidth();
          int srcHeight = src.getHeight();
          Image tmp = Image.createImage(screenWidth, srcHeight);
          Graphics g = tmp.getGraphics();
          int ratio = (srcWidth << 16) / screenWidth;
          int pos = ratio/2;
          //Horizontal Resize       
          for (int x = 0; x < screenWidth; x++) {
              g.setClip(x, 0, 1, srcHeight);
              g.drawImage(src, x - (pos >> 16), 0, Graphics.LEFT | Graphics.TOP);
              pos += ratio;
          Image resizedImage = Image.createImage(screenWidth, screenHeight);
          g = resizedImage.getGraphics();
          ratio = (srcHeight << 16) / screenHeight;
          pos = ratio/2;       
          //Vertical resize
          for (int y = 0; y < screenHeight; y++) {
              g.setClip(0, y, screenWidth, 1);
              g.drawImage(tmp, 0, y - (pos >> 16), Graphics.LEFT | Graphics.TOP);
              pos += ratio;
          return resizedImage;
      }//resize image   

    There are so many things this could be, would help if you post a screenshot, and you get a better response on these forums.
    Are you using a thin font? 30 pixels is not very much, and you often want to thicken up a font so you get atleast 1 pixel. Try a different aliasing setting?
    Do you have any layer effects, you can use layer >> layer Style >> scale effects

  • InDesign CS6 gives CMYK/RGB values when creating PDF.

    This results in a different white colors on the pdf - InDesign CS5 doesn't do this. Can someone inform me how this can be solved easily?

    Well during export to pdf the white balance of some pictures changes. This results in a pdf where white backgrounds of product shots become a different color. I clearly see it has something to do with the white balance but don't know what - tried already to export it as RGB of CMYK profile but the not all images of the same color coding (mix of RGB and CMYK saved visuals are used in one document).
    When I save the files as idml and open it in CS5, the problem is gone. So since the switch to CS6, I have this issue and as you might imagine, this is not very pratical.

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • How does one set the DPI when resizing images in Bridge?

    I am sure I am missing something here (so excuse me if its a simple answer) but I am used to using Photo Mechanic and there you are able to set lots of variables while resizing.  I don't understand this Bridge resizing window when using Batch Processing thru Photoshop. 
    -There are two boxes for sizing.  If you put the same dimension in both does it just set the longest dimension to that size?
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Thanks,
    Joshua

    You don't "resize" anything in Bridge, nor does it set PPI, pixels per inch—and most certainly NOT "DPI" (Dots [of ink] Per Inch) which is exclusively a feature of the printer.
    Bridge is just a File Browser.  It used to be called simply the Photoshop File Browser".  It doesn't open, edit, manipulate resize or even save anything.
    It merely hands the file(s) over to the appropriate application, whether that be Photoshop, adobe Camera Raw, Illustrator, InDesign or even MS Word.
    You wrote:
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Again, you mean PPI in both instances there.
    You enter that in whatever application you're sending the image from Bridge.
    For instance in Photoshop:

  • COR1 create process order change field value when save(PPCO0001)

    Dears
    When tcode: COR1 create process order, i want to change some fields value on the tab: "Goods Recpt", for example the field: Goods Recipient:                     , anyone konws how to do this? now i am trying to using the exit: PPCO0001( EXIT_SAPLCOBT_001)
    in thie eixt tables POSITION_TABLE : has this field: WEMPF (Goods Recipient) , i add some coding to change this field and save , but the change is not affect on the order . that is when open the order just create , this field is still empty.
    do i need some other process or call some other functions or some other exit to do this?
    thanks a lot for your posting.
    Edited by: Jackyguoguo on Mar 11, 2010 3:51 AM
    Edited by: Jackyguoguo on Mar 11, 2010 4:21 AM

    1. Use BADI: WORKORDER_UPDATE--> Method: BEFORE_UPDATE
    2. Use ASSIGN "(SAPLCOBT)AFPO_BT[]" statement to access and modify the desired fields.
    Regards,
    Suraj

  • 10g Preview: Change tab title when browsing javadoc

    The new method of displaying Help and Javadoc is great.
    When I display the Javadoc for a class by hitting F1 in the Code Editor, a Javadoc tab appears with the title of the class I looked up. All well and good.
    When I navigate a link in the Javadoc though, the title of the tab continues to display the name of the class I originally looked up. This can be particularly confusing if the Javadoc pane is scrolled down so the name of the currently viewed class is not visible.
    It would be nice if the tab title updated when the content of the window changed. Or, minimally, it should behave like the tab does for an IDE Help topic: just show "Javadoc" with an up-to-date tooltip for the tab reflecting the current class name. I would personally prefer the former solution though.

    Hi Alan,
    Thanks for taking the time to report this. I've logged bug 3136970.
    Thanks,
    Brian
    JDev Team

  • Why does Illustrator automatically change RGB and CMYK values

    Hi, I am struggling to understand why Illustrator is changing the values inside the RGB and CMYK boxes. I am also not sure of the exact relationship between these values. Essentially, it appears that if you set the Document Color Mode to RGB, it leaves the RGB values that you type in alone. If you set the Document Color Mode to CMYK, it leaves the CMYK values alone.
    But as soon as you change the Color Mode, it automatically modifies the values. So if you were in RGB mode and you set some RGB values, it changes those RGB values when you switch to CMYK mode. And vice versa.
    I had thought that the CMYK palette was a subset of the RGB palette. It would make sense to me if it did this when I switched from RGB to CMYK mode, but it doesn't make sense to me why it does this when I switch from CMYK to RGB mode.
    The other thing I am confused about is the relationship of the values in the RGB boxes to the values in the CMYK boxes. I would have thought that the relationship between them would be static. Actually, it is not. When I am in CMYK mode and I enter a CMYK value of 90 16 0 0, the RGB values become 0 158 222. But when I switch over to RGB mode, the RGB values of 0 158 222 result in CMYK values of 75 23 0 0.
    Very confusing.
    Thanks in advance if you can explain this behavior!
    Best Regards,
    Z.

    Color management.
    Hi, I am struggling to understand why Illustrator is changing the values inside the RGB and CMYK boxes. I am also not sure of the exact relationship between these values. Essentially, it appears that if you set the Document Color Mode to RGB, it leaves the RGB values that you type in alone. If you set the Document Color Mode to CMYK, it leaves the CMYK values alone.
    An Ai document can be either RGB or CMYK. The colors follow the document color mode and thus are converted immediately if they don't match.
    But as soon as you change the Color Mode, it automatically modifies the values. So if you were in RGB mode and you set some RGB values, it changes those RGB values when you switch to CMYK mode. And vice versa.
    Same reason.
    I had thought that the CMYK palette was a subset of the RGB palette. It would make sense to me if it did this when I switched from RGB to CMYK mode, but it doesn't make sense to me why it does this when I switch from CMYK to RGB mode.
    It's not. CMYK color spaces (there are more than just one) are normally smaller than RGB color spaces, but they aren't a "subset".
    The other thing I am confused about is the relationship of the values in the RGB boxes to the values in the CMYK boxes. I would have thought that the relationship between them would be static. Actually, it is not. When I am in CMYK mode and I enter a CMYK value of 90 16 0 0, the RGB values become 0 158 222. But when I switch over to RGB mode, the RGB values of 0 158 222 result in CMYK values of 75 23 0 0.
    When Illustrator converts the colors, it uses color management: the profiles you set up and the methods you set up. After converting it forgets the color that used to be. When converting "back", it uses color management again.
    When you convert an very bright RGB color, it be out of the CMYK gamut. So it get's converted to the closest possbile CMYK color (which might still be far away from the original color. But it's not possible to convert it "back" to the bright one unless you just revert the conversion (by Cmd/Ctrl + Z).

  • Assigning an RGB Value variable that doesnt Change

    Hi,
    I have been working on a program that takes an image, tuurns all the dark pixels to blue ones and then finds the bounderies of the blue areas. Im having difficulty detecting the Blue pixels
    Im using
    BufferedImage.getRGB(x,y) to get the value of a blue pixel
    I assigned the blue value as int blue = 0xff;
    but the program doesnt seem to pick up the same RGB value each time !
    Thanks for the help
    Graeme

    Hi,
    The code i used for fliping the coords below, Ive not touched ColorModels didnt think it was nessecary if it was just a straight forward color comparison. It sets the color but seems to be reading it in differently
    bi = getBufferedImage("C:/GB Y4/Project/Backups Project/lego/VisionSystem/Workstation/Images/image.jpeg",this);
              rgb = 0;
              // loops through and gathers the rgb values for the Image !!
              for(int a =0; a < 320; a++){
              for(int b =0; b < 240; b++){
              rgb = bi.getRGB(a,b) ;
              red = (rgb / 0x10000) & 0xff ;
              green = (rgb / 0x100) & 0xff ;
              blue = rgb & 0xff ;
              //System.out.println("Blue :" +blue );
              // loops through all the pixels in the Image 240 X 320 = 76000 pixels
              // If a Black pixel then find edge
         if(red > 0 && red < 60 || green > 0 && green < 80 || blue > 0 && blue < 80 ){
                   // TESTING (See if coordinates are being scanned)
                   //System.out.println("Black pixel found at (" + a +","+ b +")");
                   //     Replacing Pixels re-write the image boundery in Blue
                   bi.setRGB(a,b,0xff0000ff );
                   // TESTING
                   //     Saving the Position of all the Blue Pixels
                   savePos(a,b);
              

Maybe you are looking for

  • ICal shows old reminders!

    I like the new iCal design, but one thing has me confused: in Day view, iCal shows the reminders/appointments from yesterday or earlier in Today's page. In other words, iCal now, correctly, shows a big "26" at the top for today, July 26. Yet, directl

  • Encore transcoded audio into mono instead of stereo!!

    OK here is my workflow: Shot 1080p video on Sony XDCAM PMW-EX1 with stereo audio track. Imported footage using Sony XDCAM Transfer (makes .mov files). If you open the .mov files in QT Player they show as having Track 1 - Video, Track 2 - Audio (left)

  • Tecra M11-120 Mini Displayport to HDMI

    Hey there.. I received my new notebook, and bought a mini display port to HDMI adapter. On my Television, I putted the connector in, so I did to the adapter. I also swtiched the option in windows 7 on, that I would like to ampilfy my screen to the te

  • ORA-01436 CONNECT by loop in user data Oracle HRMS - How do I prevent this?

    I am getting from time to time an error when users are performing tasks in Oracle HRMS that comes back as ORA-01436 CONNECT by loop in user data. This issue is caused when there exists a loop in the Supervisor hierarchy. For ex: Emp A reports to Emp

  • Set up table data extracted from R/3 not visible in data target of BW

    Hai friends,          I am currently working on extracting data from R/3 to BW. I read the several docs given in the forum and did the following:   1) In the LBWE transaction, my extract structure is already active.   2) In SBIW, i went to the fillin