Getting the colour of a pixel in an Image?

Can I get the colour of a pixel in J2ME, like BufferedImage.getRGB(int x, int y) in J2SE?
Thanks.

Did you manage to solve this one? I am trying to do something very similar, but can't find the J2ME equivalents either.
Graham.

Similar Messages

  • Get the color of a pixel in an image

    how can i do to get the color of a pixel in an image ???
    Can anyone help me ?

    Hi,
    first of all you need to get the library to transfer your image to java.awt.image.BufferedImage object.
    I know many such libraries. Its depends of what kind of image you have: jpeg, gif, png or other.
    And when you get the BufferedImage of you picture using library, then you can get the color of any pixel in image using int BufferedImage.getRGB(int x, int y) as integer value.
    Victor Letunovsky

  • Getting the Color of a Pixel in a Image

    Hi. I need to get the Color of the point in an Image (or ImageIcon). I've seen examples but they use BufferedImages.
    Thanks, Bob

    Here is a simple conversion for you:
    BufferedImage bi = new BufferedImage(myImage, myImage.getWidth(null), myImage.getHeight(null), BufferedImage.TYPE_INT_RGB);
    Graphics g = bi.getGraphics():
    g.drawImage(myImage, 0, 0, null);If you are using ImageObserver objects, then replace null with the corresponding ImageObserver object in the BufferedImage and drawImage.

  • Getting the index of a pixel in an indexed image

    Hi,
    Is it possible to get the index of a pixel in an indexed image? I mean, indexed images (GIF, indexed PNG) are like:
    INDEX R G B
    0 234 22 143
    1 9 123 213
    2 56 43 10
    etc.
    I'm wondering if it exists a GET method to retrieve this INDEX, as getRGB() retrieves the sRGB value of a pixel.
    Thanks in advance.

    Raster.getSample:
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    public class IndexColorModelTest {
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://forum.java.sun.com/images/reply.gif");
            BufferedImage bi = ImageIO.read(url);
            ColorModel cm = bi.getColorModel();
            if (!(cm instanceof IndexColorModel))
                throw new IOException("ColorModel is " + cm.getClass());
            WritableRaster r = bi.getRaster();
            for(int y=0, uby=r.getHeight(); y<uby; ++y) {
                for(int x=0, ubx=r.getWidth(); x<ubx; ++x) {
                    int sample = r.getSample(x, y, 0); //<<--------<<
                    //if (sample < 100)
                    //    System.out.print(" ");
                    if (sample < 10)
                        System.out.print(" ");
                    System.out.print(sample);
                System.out.println();
    }

  • Get the color of a pixel on the Stage

    Is there a way to retrieve the color of a generic pixel on the screen using the mouse pointer inside the Stage of Flash Player? With the getPixel method of the BitmapData class you can get the color of a pixel only if the mouse is over a bitmap image, but what if I need the color a generic pixel on the screen?

    this takes a snapshot of the pixel below the mouse:
    function eventHandler(event:MouseEvent):void
         var bmd:BitmapData = new BitmapData(1, 1, false, 0x000000);
         var matrix:Matrix = new Matrix();
         matrix.translate(event.stageX, event.stageY);
         //can never remember which way translate works so it could be:
         //matrix.translate(-event.stageX, -event.stageY);
         bmd.draw(stage, matrix);
         var pixelColour:uint = bmd.getPixel(0, 0);
    my blog has more info: http://blog.leeburrows.com/2010/09/bitmapdata-basics-1/

  • I changed the passlock screen somehow and now it's grey and boring when I type my code in how do I get the colours back?

    I changed the passlock screen somehow and now it's grey and boring when I type my code in how do I get the colours back?

    You're welcome.
    Be aware, eye candy ***** more battery.

  • My Mac is travelling extremely slow. Applications bounce for at least a minute before opening (if they open at all). Any time i click the mouse or start typing i intantly get the colour wheel. Help!!!

    My Mac Daddy is running extremely super slow. It has been gradually getting slower over the last week or so but now it is ridiculous. Not just safari. Apps bounce for about a minute before opening (if they open at all) have had a "Application not responding" message when i right click on the icon. Every single time i click the mouse or begin to type i get the colour wheel. I have Mac Keeper and have runs scans, all okay and now mac keeper wont open at all. It even takes a couple of minutes to quit apps and even to shut down. HELP!!!

    To build on you main question, i would take a look at this:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility.  For situations DU cannot handle the best third-party utilities are: Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation.  TechTool Pro 4.5.1 or higher are Intel Mac compatible;  Drive Genius is similar to TechTool Pro in terms of the various repair services provided.  Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.  These utilities have limited or no functionality with Snow Leopard and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.  Other utilities are also available such as Onyx, Leopard Cache Cleaner, CockTail, and Xupport, for example.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.
    If you still are not happy with performance then consider reinstalling Snow Leopard:
    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.

  • I keep getting the colour wheel of death after upgrading to mountain lion

    Hi,
    I'm not sure if anyone else has had this problem but I recently upgraded my Early 2009 24" Imac to Mountain Lion and I keep getting 'The colour wheel of death' appearing.
    It happens all the time and last about 20-30seconds, in this time the machine hangs. Then it stops and everything is fine. However, it happens every 10-15mins.
    The machine is a work machine so this problem is very frustrating and very time consuming.
    I've googled the issue and taken a look at a website www.thexlab.com who reference something called SBBOD.
    I've done what they suggest and tried keeping an eye what applications might be the cause by looking at the activity monitor but its seems its the finder.
    I've re-installed mountain lion with no joy.
    I'd like to go back to Lion but not sure how!
    Can anyone help either solve the problem or help me go back to Lion?
    Frustrated live long mac user.

    http://www.reedcorner.net/understanding-upgrade-nightmares/ (Thomas)
    See if you have supported applications > http://www.roaringapps.com

  • In Preview, I suddenly am unable to get the "Adjust Color" tool panel to edit images. I just get the rectangular image selection tool instead. How do I ge the "Adjust Color" tool panel back?

    In Preview, I suddenly am unable to get the "Adjust Color" tool panel to edit images. I just get the rectangular image selection tool instead. How do I ge the "Adjust Color" tool panel back?

    Hmmm, I wonder if that window is hidden or off screen? Have you moved the pic window around to look under it?
    Might try this...
    Safe Boot , (holding Shift key down at bootup), use Disk Utility from there to Repair Permissions.
    Then move these files to the Desktop for now...
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.desktop.plist
    /Users/YourUserName/Library/Preferences/com.apple.recentitems.plist
    /Users/YourUserName/Library/Preferences/com.apple.Preview.plist
    /Users/YourUserName/Library/Preferences/com.apple.Preview.bookmarks.plist
    Reboot & test.
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.

  • How do I get the colour board to show percentages?

    Underneath the colour corrections, I am unable to see a reference. How do I view this?
    e.g. when moving the mid-tones spot, I do not get a numerical reference underneath the board? All colour grading tutorials show a numerical tablet underneath the colour board, allowing easier reference points...is this something that can be switched on and off?
    Many thanks,
    Tom

    Just make sure that there is enough room to show them. Increase the size of the colour board by dragging on the lighter grey are here:

  • Itunes freezes on my mac mini?? its okay for the first few minutes then freezes. i just then get the colour wheel and have to 'force close'

    hi there, i have major problems with itunes freezing on my mac Mini, its okay for the first minute or two then it freezes and i get the spinning colour wheel and i have to force close.
    can anyone help?

    I suspect that you'll have to mount that volume at boot time and not at login time as you're doing now.  If you can arrange that, then the volume should be available to all users.
    Unfortunately, there doesn't seem to be an easy way to do a boot-time mount.  I tried searching for "mount drive startup mac" (without the quotes), but most of the results described how to mount a volume at login time.  Ignore any advice that mentions "Login Items".
    I did find this discussion, but it's very sketchy.  You also have to be careful that any advice you find applies to the version of OS X that you're using.

  • Help! iPhoto suddenly won't launch - just get the coloured spinning wheel

    Help! My photos are so important to me.  I store my iPhoto on an external drive as I was running out of space on my Macbook.  I haven't had any trouble accessing the drive.  All of a sudden, a couple of days ago, when I tried opening iPhoto, all that would happen is that I'd get a coloured spinning wheel, nothing would happen and ultimately I'd have to Force Quit the application.
    This is terrifying me!  Please advise how I sort this out.
    I have backed up to Time Machine (though I stupidly haven't actually checked if the photos have been backing up properly) - I have tried opening Time Machine to see if the photos are all there (30,000+) but can't open the backed up iPhoto without the iPhoto application working!  So seems incredibly frustrating and scary.
    Please advise...  Thank you!

    Delete the cache file ~/Library/Caches/com.apple.iPhoto
    Move that file to the trash and secure empty it. You can try to do a normal empty but it normally doesn't allow go through.

  • I can't get the colours of my slide show to match my mac when using a projector

    I created a presentation using Keynote 6. It worked perfectly with a projector until a disorganized presenter asked to use my computer to present his powerpoint presentation. When I ran mine directly afterwards the colours had been affected. I don't know what changed and I don't know how set it up again.

    I just hit the home key very fast 3 times and it worked. Glad to see that someone suggested this to another person with a mini. My gremlins are all gone.  Yea to the forum .......Marci 73361

  • How to get the local file system path of an image that loaded into the image component in cq5?

    Hi,
    I'm having hard time uploading image from filesystem where as drag and drop works.
    I'm not getting a path of image selected from filesystem.
    here is my code..
    private String populateImage() throws Exception {
                        if (currentNode != null && currentNode.isNode()) {
                                       Node ImageNode = JcrResourceUtil.createPath(currentNode, "image",
                                                                          null, "nt:unstructured", true);
                                       imageUrl = ImageNode.hasProperty("fileReference") ? ImageNode.getProperty("fileReference").getValue().getString() : "";
           imageUrl = imageUrl.trim();
            log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE IF IS: " + imageUrl);
                        } else {
                                            imageUrl = properties.get("fileReference", "");
                                            imageUrl = imageUrl.trim();
                                            log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE ELSE IS: " + imageUrl);
                        return imageUrl;
    So if I drag and drop..
    ImageNode.hasProperty("fileReference") is returning a valid path
    but if I upload an image  it is returning Null.
    So how to get the path? any suggestions around would be appreciated...

    When you say path you mean you want the path to print out in your HTML? Is that accurate? If so you generally need to constructe that path based on the path to the current component. So if you component is located at /content/mysite/en/about/mypage/jcr:content/parsys/image then the path to the image would generally be something like /content/mysite/en/about/mypage/jcr:content/parsys/image.img.jpg/1283829292873.jpg. The .img. selector triggers the servlet associated with the foundation parbase - /libs/foundation/components/parbase/img.GET.java. The reason you reference it this way is that there is no filesystem path to the image - it is stored in the repository not on the file system, and it requires a servlet or script to ge the binary from the repository and steam it.
    Normally the way you'd construct this is to use the out of the box Image class - so look at /libs/foundation/components/image/image.jsp. Now this example assumes that your component where you loaded the image extends /libs/foundation/components/parbase. If it doesn't then you either have to change your sling:superResourceType to /libs/foundation/components/parbase or some other component that does exten /libs/foundation/components/parbase.

  • Open images in the Photoshop window look pixelated, but same images in Acrobat or viewer look fine. Help in resolving? Link to screenshots.

    Some files and images I open in the Photoshop window look pixelated or choppy, but when I open in Acrobat or viewer they look fine. This just started about two weeks ago. I reset my settings, and all of the the help topics come up for blurry images/re-sizing. I have had this problem with .tiff, jpg, and pdf files.
    Thank you!!
    Photoshop CS6 Ver.13.0.1x64
    Windows 7 Professional Intel(R) Core(TM) i5-3340M CPU @ 2.70GHz
    AMD (ATI) FirePro M6000 (FireGL V) Mobility Pro Graphics
    PROBLEM SAMPLE
    Photshop_Screenshot_PDF
    Same_Image_Acrobat

    That black degradation in the background at the top looks like an old ATI driver bug where if for a given pixel the red channel reaches zero all three colors of the pixel would go black.  I think that was a couple of years ago we were seeing that.
    See if AMD has released newer drivers for your FirePro card.
    -Noel

Maybe you are looking for