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


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

Re: BufferedImage and int[] array

Newsgroups comp.lang.java.programmer
Date 2017-04-21 13:54 -0700
References (2 earlier) <0f806bdc-aa93-4897-bb9f-8373ffd16175@googlegroups.com> <903d6ec5-ab8e-4e87-9581-13ff803bf461@googlegroups.com> <a2ae1966-1dc0-4019-8286-16a5825ba843@googlegroups.com> <125e8758-3bf6-453b-8c5c-cadd339a0ebf@googlegroups.com> <e09756ab-7d8b-49ea-a529-6d6b71a8554f@googlegroups.com>
Message-ID <76664d4e-bc0e-4f10-9262-171f4db6d6fe@googlegroups.com> (permalink)
Subject Re: BufferedImage and int[] array
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Friday, April 21, 2017 at 4:37:47 PM UTC-4, Rick C. Hodgin wrote:
> That code was all written last night and when I ran into the issue
> with reading in a transparent enabled PNG file and it losing the
> alpha channel I sort of stopped.
> 
> The algorithm is inverting the color.  This line reverses the color
> of each pixel color channel:
> 

I believe I did figure out the invert was trying to invert the colors not the horizontal.  Change the pixels line in the invert to pass the actual alpha:
pixels[offset] = rgba(255 - red, 255 - grn, 255 - blu, (rgba & 0xff000000) >> 24);

Then change the rgba method to just add them.
return(red + (grn << 8) + (blu << 16) + (alp << 24));

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