Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #24005
| Date | 2013-05-11 09:28 +0100 |
|---|---|
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
| Organization | Trollbusters 3 |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: How to convert image into Hex 2 Dimensional Array? |
| References | <41718873-b1a6-4b97-bbbb-8002c48d4e29@googlegroups.com> <kmdvmk$8vv$1@dont-email.me> <UMCdnSKnDMu9ExfMnZ2dnUVZ7oOdnZ2d@bt.com> <kme6pl$kid$1@dont-email.me> |
| Message-ID | <QfidnRlCZaKEnBPMnZ2dnUVZ8o2dnZ2d@bt.com> (permalink) |
On 08/05/13 19:54, Joshua Cranmer đ§ wrote: > On 5/8/2013 12:40 PM, lipska the kat wrote: >> On 08/05/13 17:52, Joshua Cranmer đ§ wrote: >>> On 5/8/2013 1:30 AM, sout saret wrote: >>>> Dear Community! >>>> >>>> May you help me how to write code in java to convert image to Hex 2 >>>> dimensional array. I want to show format as below: >>> >>> What format is this two-dimensional array? Looking from your code, you >>> appear to want it to be some sort of 256-byte pixel value, but are you >>> desiring: >>> 1. 8-bit ARGB >>> 2. 5-6-5 RGB >>> 3. 8-bit grayscale >>> 4. 32-bit ARGB >>> 5. 24-bit RGB >>> 6. Binary version of any widely-used image format, including but not >>> limited to PNG, BMP, GIF, JPG, XBM, TIF, and ICO. >> >> I think he wants a byte for byte copy so the first byte gets copied into >> [0][0] the next into [1][0] the next [2][0] etc until [width-1][0] >> then start again at [0][1], [1][1], [2][1] etc etc > > A byte for byte copy of what? I'm guessing the answer is the "pixel > matrix", but that's underdefined since pixels can take on many different > formats, which is what I was trying to get at--what encoding of a pixel > is desired? I've been thinking about this and actually, in a byte for byte copy the 'encoding' of a pixel is irrelevant. If I open a (for example) jpg image in a hex viewer(ghex) all I see is a bunch of bytes. As far as ghex is concerned that's all it is. The bunch of bytes is only an image if it is interpreted as an image by software that knows how to interpret the data *as an image*. So, as far as reading the data goes, all we have is a stream of bytes. If we want to store these bytes in a matrix(for whatever reason) we may have an immediate problem. It may be the case that the byte count is not a 'perfect square', what this means is that there may eventually be a number matrix cells that will not contain data that is relevant to the byte stream we are reading. So, how do we determine where in the matrix our data ends and the default values used to populate the arrays on creation begin? If we use byte[][] we have a problem. All byte values from 0x00 - 0xFF *could* be valid data, byte arrays have each cell initialized to 0 (0x00) Byte arrays however have each cell initialized to null. It will therefore be very easy to determine the end of data in a Byte[][] matrix. In a byte[][] matrix we would have to add some information somewhere outside of the matrix. This situation only really applies if we wish to store our bytes in a matrix. Obviously this is *not* a problem if we store the bytes in a single dimension array. So, I'm not so sure that the original advice was as bad as all that, it depends on the end usage of the stored data. As ever I'd be interested in any comments. lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to convert image into Hex 2 Dimensional Array? sout saret <saretmis097@gmail.com> - 2013-05-07 23:30 -0700
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 09:06 +0100
Re: How to convert image into Hex 2 Dimensional Array? Joerg Meier <joergmmeier@arcor.de> - 2013-05-08 12:29 +0200
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 13:28 +0100
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-08 15:19 +0200
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 14:57 +0100
Re: How to convert image into Hex 2 Dimensional Array? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-08 08:22 -0700
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 17:03 +0100
Re: How to convert image into Hex 2 Dimensional Array? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-08 13:44 -0700
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 17:48 +0100
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-08 21:10 -0400
Re: How to convert image into Hex 2 Dimensional Array? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-08 12:52 -0400
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-08 17:32 +0200
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 17:17 +0100
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-08 18:46 +0200
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 18:25 +0100
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-08 23:24 +0200
Re: How to convert image into Hex 2 Dimensional Array? Joshua Cranmer đ§ <Pidgeot18@verizon.invalid> - 2013-05-08 11:46 -0500
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-08 21:04 -0400
Re: How to convert image into Hex 2 Dimensional Array? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-08 21:45 -0400
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-08 21:59 -0400
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-08 22:03 -0400
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-09 04:09 +0200
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-09 04:09 +0200
Re: How to convert image into Hex 2 Dimensional Array? Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-08 23:18 -0400
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-09 22:05 -0400
Re: How to convert image into Hex 2 Dimensional Array? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-10 09:46 -0700
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-10 19:02 +0200
Re: How to convert image into Hex 2 Dimensional Array? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-10 11:00 -0700
Re: How to convert image into Hex 2 Dimensional Array? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-10 23:42 +0200
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-10 18:20 -0400
Re: How to convert image into Hex 2 Dimensional Array? Jeff Higgins <jeff@invalid.invalid> - 2013-05-08 12:43 -0400
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 18:45 +0100
Re: How to convert image into Hex 2 Dimensional Array? Jeff Higgins <jeff@invalid.invalid> - 2013-05-08 11:18 -0400
Re: How to convert image into Hex 2 Dimensional Array? Joshua Cranmer đ§ <Pidgeot18@verizon.invalid> - 2013-05-08 11:52 -0500
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 18:40 +0100
Re: How to convert image into Hex 2 Dimensional Array? Joshua Cranmer đ§ <Pidgeot18@verizon.invalid> - 2013-05-08 13:54 -0500
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-08 20:43 +0100
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-11 09:28 +0100
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-11 08:50 -0400
Re: How to convert image into Hex 2 Dimensional Array? lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-05-11 15:00 +0100
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-12 21:45 -0400
Re: How to convert image into Hex 2 Dimensional Array? Manuel Dahmen <manuel.dahmen@gmail.com> - 2013-05-08 15:38 -0700
Re: How to convert image into Hex 2 Dimensional Array? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-11 13:33 -0700
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-12 21:48 -0400
Re: How to convert image into Hex 2 Dimensional Array? markspace <markspace@nospam.nospam> - 2013-05-12 20:49 -0700
Re: How to convert image into Hex 2 Dimensional Array? Arne VajhĂžj <arne@vajhoej.dk> - 2013-05-13 19:08 -0400
Re: How to convert image into Hex 2 Dimensional Array? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-15 03:45 -0700
Re: How to convert image into Hex 2 Dimensional Array? Roedy Green <see_website@mindprod.com.invalid> - 2013-05-15 03:50 -0700
csiph-web