comp.lang.ada
 help / color / mirror / Atom feed
From: Anatoly Chernyshev <achernyshev@gmail.com>
Subject: Re: Question: re Image Files.
Date: Sun, 2 Sep 2012 23:02:45 -0700 (PDT)
Date: 2012-09-02T23:02:45-07:00	[thread overview]
Message-ID: <55aade96-7c5d-45a7-a211-cb2c7f04ceeb@googlegroups.com> (raw)
In-Reply-To: <50406532$0$10734$5b6aafb4@news.zen.co.uk>

> Would I be correct in guessing that you are planning in reading these
> 
> files with the intention of encrypting the contents?
> 
> If so, then you can save yourself a MASSIVE amount of work by ignoring
> 
> the structure of the files, and simply reading them byte-by-byte. That
> 
> way you get a stream of numbers, all in the range 0-255, and as long
> 
> as the decryption process returns the numbers to exactly what the
> 
> original number was without missing or adding any, you can encrypt any
> 
> file you like.

This way the image data will be lost, because the headers will be screwed as well. Apparently Austin is trying to play with the pixels only (e.g. for steganography purposes or whatever).

When I had similar problem I've chosen PNG format as input (because the IO library was immediately available at http://sourceforge.net/projects/png-io). For the output I had to write my own package for uncompressed 24 bpp BMPs (because the format is simple). Then PNG is converted into an integer matrix, which could be manipulated any way you like, and then written at any time as BMP (which could later be converted by any graphic editor to other formats if needed).

If interested, I put relevant files in www.achernyshev.com/tmp/bmp24bppout.rar



  parent reply	other threads:[~2012-09-03  6:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 22:33 Question: re Image Files Austin Obyrne
2012-08-30 22:55 ` Adam Beneschan
2012-08-31  1:35 ` tmoran
2012-08-31  7:16 ` Dmitry A. Kazakov
2012-08-31  7:18 ` Mark Murray
2012-08-31  8:58   ` Austin Obyrne
2012-08-31  9:25     ` Ludovic Brenta
2012-08-31  9:41       ` Dmitry A. Kazakov
2012-08-31  9:14   ` Austin Obyrne
2012-08-31 17:09     ` Mark Murray
2012-08-31 17:36       ` Austin Obyrne
2012-08-31 22:09         ` Shark8
2012-09-04 10:05         ` Antti Louko
2012-08-31 21:12   ` gautier_niouzes
2012-09-01  6:58     ` Austin Obyrne
2012-09-03  6:02   ` Anatoly Chernyshev [this message]
2012-09-03  7:27     ` Mark Murray
2012-08-31  8:41 ` Brian Drummond
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox