Results 1 to 3 of 3

Thread: Color Balance

  1. #1
    THEAniKan is offline Member
    Join Date
    Sep 2009
    Posts
    15
    Rep Power
    0

    Question Color Balance

    I need a subroutine:

    Java Code:
    public BufferedImage colorBalance(BufferedImage src, Color r, Color g, Color b)
    it takes the BufferedImage, and adds color balance to the image, and returns it.

    I am making a lightsaber maker program, pretty much the same as LSMaker (lsmaker.uw.hu), and i need this for the rendering.

    The person who solves this will get credited.

    I have a preview on YouTube, search for "THEAniKan" and scroll down to it.

    I would put a link, but i don't have 25 posts yet...

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    I have solved it!! Give me the loot. It's all my mine.

  3. #3
    THEAniKan is offline Member
    Join Date
    Sep 2009
    Posts
    15
    Rep Power
    0

    Default

    So, i got some more done. Now you atleast can have the rgb values for each pixel.

    Java Code:
        public BufferedImage colorBalance(BufferedImage src, byte red, byte green, byte blue)
        {
            int width = src.getWidth();
            int height = src.getHeight();
            for(int i = 0; i < width; i++)
            {
                for(int j = 0; j < height; j++)
                {
                    int rgb = src.getRGB(i,j);
                    int a = (rgb >>> 24) & 0xFF;
                    int r = (rgb >>> 16) & 0xFF;
                    int g = (rgb >>> 8) & 0xFF;
                    int b = (rgb >>> 0) & 0xFF;
                }
            }
            return src;
        }

Similar Threads

  1. Binary Tree Deletion & Balance Methods
    By sev51 in forum New To Java
    Replies: 1
    Last Post: 01-27-2009, 04:26 PM
  2. color texts
    By layst in forum New To Java
    Replies: 1
    Last Post: 10-22-2008, 02:47 PM
  3. Color TabbedPane Example
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:36 PM
  4. Color objects
    By CyberFrog in forum New To Java
    Replies: 4
    Last Post: 04-01-2008, 12:41 AM
  5. A bit of color!
    By tim in forum Java 2D
    Replies: 8
    Last Post: 02-11-2008, 11:57 PM

Tags for this Thread

Posting Permissions

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