Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36517

Re: BufferedImage and int[] array

Newsgroups comp.lang.java.programmer
Date 2017-04-24 08:04 -0700
References <5a1d0bab-5ae7-45a1-9c8f-344183ed48ba@googlegroups.com> <odg05k$e1f$1@dont-email.me> <b700089d-64f7-4774-8adc-af45426847b6@googlegroups.com>
Message-ID <6b44223f-7bc1-4093-9052-2eb253c8abbb@googlegroups.com> (permalink)
Subject Re: BufferedImage and int[] array
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Monday, April 24, 2017 at 10:34:16 AM UTC-4, Rick C. Hodgin wrote:
> > import java.awt.*;
> > import java.awt.image.*;
> > import java.io.*;
> > import javax.imageio.*;
> > 
> > public class test6 {
> >      public static void main(String... args) throws Exception {
> >          BufferedImage img =
> >           new BufferedImage(640,480,BufferedImage.TYPE_INT_RGB);
> >          Graphics2D g = img.createGraphics();
> >          g.setColor(Color.RED);
> >          g.fillRect(0,0,213,480);
> >          g.setColor(Color.GREEN);
> >          g.fillRect(214,0,214,480);
> >          g.setColor(Color.BLUE);
> >          g.fillRect(428,0,213,480);
> >          g.dispose();
> >          ImageIO.write(img,"JPEG",new File("bars.jpg"));
> >      }
> > }
> > 
> > import java.awt.image.*;
> > import javax.imageio.*;
> > import java.io.*;
> > 
> > public class test5 {
> >      public static void main(String... args) throws Exception {
> >          BufferedImage img = ImageIO.read(new File("bars.jpg"));
> >          RescaleOp op = new RescaleOp(-1.0f,255f,null);
> >          BufferedImage chg = op.filter(img,null);
> >          ImageIO.write(chg,"JPEG",new File("bars2.jpg"));
> >      }
> > }
> 
> Is this for the color invert operation?  I notice it creates a new
> BufferedImage.  Is there a way to apply the operation on the bits
> within the original image directly?
> 
> Thank you,
> Rick C. Hodgin

test6 creates a dummy image, the input for test5, which just modifies an existing image.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 08:28 -0700
  Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 08:54 -0700
    Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 09:03 -0700
      Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 10:41 -0700
        Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 10:46 -0700
        Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 11:13 -0700
          Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 12:12 -0700
          Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 13:24 -0700
            Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 13:37 -0700
              Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 13:40 -0700
              Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 13:54 -0700
                Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 13:59 -0700
              Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-21 13:58 -0700
                Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-21 14:06 -0700
  Re: BufferedImage and int[] array Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-04-22 11:28 -0500
    Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-24 07:33 -0700
      Re: BufferedImage and int[] array Eric Douglas <e.d.programmer@gmail.com> - 2017-04-24 08:04 -0700
    Re: BufferedImage and int[] array "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-04-24 08:17 -0700
      Re: BufferedImage and int[] array Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-04-24 11:25 -0500

csiph-web