Results 1 to 8 of 8
  1. #1
    ankurshanbhag is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Question Image Processing in Java

    Hello friends, I m facing an problem in image processing which is an part of my final year project. I want to manipulate pixels of an image, such as change color, recognize certain areas within an image based on pixel values etc. Can someone help me out.

  2. #2
    Hibernate's Avatar
    Hibernate is offline Senior Member
    Join Date
    Dec 2010
    Location
    Stockholm, Sweden
    Posts
    222
    Blog Entries
    9
    Rep Power
    4

    Default

    Use buffered images (java.awt.image.BufferedImage).
    Constructor: BufferedImage(width, height, image type)
    I would recommend BufferedImage.TYPE_INT_ARGB as image type, but where are other types.
    img.createGraphics() creates a Graphics2D.
    img.getRGB(x, y) gets a pixel's colour.
    img.setRGB(x, y, colour) sets a pixel's colour.

    Java Code:
    import java.awt.image.BufferedImage;
    
    {
        BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB)
    
        int argbValue = img.getRGB(x, y); //gets the colour on a pixel
    
        alpha = ?
        red = ?
        green = ?
        blue = ?
    
        argbValue = alpha << (3 * 8)
        argbValue += red << (2 * 8)
        argbValue += green << (1 * 8)
        argbValue += blue << (0 * 8)
    
        img.setRGB(x, y, argbValue); //sets the colour on a pixel
    }

    If you handle pixel-per-pixel editing, take a look at http://download.oracle.com/javase/1.5.0/docs/api/java/awt/image/BufferedImage.html#getRGB(int, int, int, int, int[], int, int).
    Last edited by Hibernate; 12-28-2010 at 02:01 AM.

  3. #3
    ankurshanbhag is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default

    Thank you, thanks a lot.

  4. #4
    mackfrank is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default resolve?

    Hi i was just wondering if that answer had resolved thr question for you?

  5. #5
    ankurshanbhag is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default

    Yeah, quite a bit ....if someone has other solutions, they are most welcome ...

  6. #6
    Hibernate's Avatar
    Hibernate is offline Senior Member
    Join Date
    Dec 2010
    Location
    Stockholm, Sweden
    Posts
    222
    Blog Entries
    9
    Rep Power
    4

    Default

    Have you tried Java Advanced Imaging Java Advanced Imaging (JAI) API

    I haven't tried it, but it could be something.
    Ex animo! Hibernate
    Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.

  7. #7
    ankurshanbhag is offline Member
    Join Date
    Dec 2010
    Posts
    5
    Rep Power
    0

    Default

    Thank u @Hibernate. Java Advanced Imaging is quite useful from my project point of view. Do u have good knowledge about image processing. I need help to sort out few issues in image processing. Do reply.

  8. #8
    Hibernate's Avatar
    Hibernate is offline Senior Member
    Join Date
    Dec 2010
    Location
    Stockholm, Sweden
    Posts
    222
    Blog Entries
    9
    Rep Power
    4

    Default

    I have never used JAI, but post your issue and maybe someone can help you.
    Ex animo! Hibernate
    Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.

Similar Threads

  1. image processing
    By sunithamm in forum Advanced Java
    Replies: 6
    Last Post: 12-30-2010, 11:46 AM
  2. Image processing
    By ranadav in forum Advanced Java
    Replies: 3
    Last Post: 06-05-2010, 03:22 PM
  3. Image processing
    By syarizma in forum Advanced Java
    Replies: 6
    Last Post: 08-17-2009, 05:15 AM
  4. Image Processing
    By Josh_FL in forum Advanced Java
    Replies: 4
    Last Post: 12-30-2008, 02:45 AM
  5. image processing
    By sathish natrajan in forum Java 2D
    Replies: 2
    Last Post: 11-06-2008, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •