A Photography forum. PhotoBanter.com

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PhotoBanter.com forum » Digital Photography » Digital SLR Cameras
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

'extra' lossless compression for camera raw images



 
 
Thread Tools Display Modes
  #41  
Old March 24th 08, 04:43 AM posted to rec.photo.digital,rec.photo.digital.slr-systems
Sachin Garg[_2_]
external usenet poster
 
Posts: 105
Default 'extra' lossless compression for camera raw images


"KandorMan" wrote in message
...
On 19 Mar 2008 16:47:38 GMT, ray wrote:

On Wed, 19 Mar 2008 01:28:47 +0530, Sachin Garg wrote:

I just finished writing a small tool (sgraw) which can losslessly
compress camera raw images, usually between 20-to-60%. (Regulars here
might recall I have mentioned this 'possibility' earlier, I finally put
in some hours to actually build a working demo :-)

http://www.sachingarg.com/compression/sgraw/

That would be savings between 1GB to 3GB for every 5GB of data.

Even when camera has already compressed the raw image (which isn't
always the case), its still possible to squeeze out extra compression as
cameras have to use simple algorithms for speed.

Compression is totally lossless, we get back the exact file we start
with (just like with zip), so both pixel information and meta-data are
perfectly restored.

This is just the first quick hack version (and supports all nikon and
fuji cameras), so it obviously wouldn't make sense to actually use it
for backups etc, but if there is enough interest I can build it further
to support other raw formats, along with improved compression and speed.

Your thoughts on this?


It seems totally superfluous since there are already dozens of
compression programs available. What makes you think you've discovered
some 'new and improved' algorithm?


Agreed. I just used WinRAR on a couple of RAW files and got anywhere from
38% to
52% compression rates by just using its auto defaults. RAR is a well-known
and
universal compression method that works well for all multimedia formats.


Yes, general purpose compressors like rar/bzip2/zip etc can give good
results if original raw format did not use any compression (lossless). sgraw
is tuned for raw images, so it can give consistently better results than
them (theoritically at better speed too, but current implementation is slow.
I will try to improve this).

Besides, it can further compress the raw files even if they were already
compressed. Compression ratio is relatively less in this case as there are
technical limitations.

I would love to see any results different from what I found in my testing.
Which camera's raw files did you use for your tests? If these were from a
Nikon or Fuji, I am hoping that you will be amazed to see the difference
when using sgraw. If it was some other camera then we will have to wait till
I can work on those formats.

Unless
you can consistently do greater than 50-60% on all RAW files it's not
worth
anyone's time to test this for you. Well, except as your own as a learning
exercise and a way to get attention for wasting everyone else's time and
resources in doing so.


Fortunately, not everyone uses 'all' the cameras :-) If its getting results
on your raw files which are good enough for you, I will be happy to know
that you can find it useful. Otherwise, my apologies for wasting your time.
(If rar is getting those results you mentioned on your raw files, I am very
optimistic that you will like what sgraw will manage to do for you :-)

Sachin Garg [India]
www.sachingarg.com | www.imagecompression.info


  #42  
Old March 24th 08, 04:02 PM posted to rec.photo.digital,rec.photo.digital.slr-systems
ray
external usenet poster
 
Posts: 2,278
Default 'extra' lossless compression for camera raw images

On Mon, 24 Mar 2008 10:13:05 +0530, Sachin Garg wrote:

"KandorMan" wrote in message
...
On 19 Mar 2008 16:47:38 GMT, ray wrote:

On Wed, 19 Mar 2008 01:28:47 +0530, Sachin Garg wrote:

I just finished writing a small tool (sgraw) which can losslessly
compress camera raw images, usually between 20-to-60%. (Regulars here
might recall I have mentioned this 'possibility' earlier, I finally
put in some hours to actually build a working demo :-)

http://www.sachingarg.com/compression/sgraw/

That would be savings between 1GB to 3GB for every 5GB of data.

Even when camera has already compressed the raw image (which isn't
always the case), its still possible to squeeze out extra compression
as cameras have to use simple algorithms for speed.

Compression is totally lossless, we get back the exact file we start
with (just like with zip), so both pixel information and meta-data
are perfectly restored.

This is just the first quick hack version (and supports all nikon and
fuji cameras), so it obviously wouldn't make sense to actually use it
for backups etc, but if there is enough interest I can build it
further to support other raw formats, along with improved compression
and speed.

Your thoughts on this?

It seems totally superfluous since there are already dozens of
compression programs available. What makes you think you've discovered
some 'new and improved' algorithm?


Agreed. I just used WinRAR on a couple of RAW files and got anywhere
from 38% to
52% compression rates by just using its auto defaults. RAR is a
well-known and
universal compression method that works well for all multimedia
formats.


Yes, general purpose compressors like rar/bzip2/zip etc can give good
results if original raw format did not use any compression (lossless).
sgraw is tuned for raw images, so it can give consistently better
results than them (theoritically at better speed too, but current
implementation is slow. I will try to improve this).

Besides, it can further compress the raw files even if they were already
compressed. Compression ratio is relatively less in this case as there
are technical limitations.

I would love to see any results different from what I found in my
testing. Which camera's raw files did you use for your tests? If these
were from a Nikon or Fuji, I am hoping that you will be amazed to see
the difference when using sgraw. If it was some other camera then we
will have to wait till I can work on those formats.

Unless
you can consistently do greater than 50-60% on all RAW files it's not
worth
anyone's time to test this for you. Well, except as your own as a
learning exercise and a way to get attention for wasting everyone
else's time and resources in doing so.


Fortunately, not everyone uses 'all' the cameras :-) If its getting
results on your raw files which are good enough for you, I will be happy
to know that you can find it useful. Otherwise, my apologies for wasting
your time. (If rar is getting those results you mentioned on your raw
files, I am very optimistic that you will like what sgraw will manage to
do for you :-)

Sachin Garg [India]
www.sachingarg.com | www.imagecompression.info


Actually, I have found that converting to DNG does quite well. And, of
course, DNG is supported already by photo editors, so no need to convert
back.

  #43  
Old March 24th 08, 10:38 PM posted to rec.photo.digital,rec.photo.digital.slr-systems
ray
external usenet poster
 
Posts: 2,278
Default 'extra' lossless compression for camera raw images

On Mon, 24 Mar 2008 16:31:25 -0400, me wrote:

On 24 Mar 2008 16:02:42 GMT, in rec.photo.digital ray
wrote:


Actually, I have found that converting to DNG does quite well. And, of
course, DNG is supported already by photo editors, so no need to convert
back.


You can't, as DNG doesn't preserve 100% of the metadata.


Of course I can.
  #44  
Old March 24th 08, 11:53 PM posted to rec.photo.digital,rec.photo.digital.slr-systems
John McWilliams
external usenet poster
 
Posts: 6,945
Default 'extra' lossless compression for camera raw images

wrote:
On 24 Mar 2008 22:38:33 GMT, in rec.photo.digital ray
wrote:

On Mon, 24 Mar 2008 16:31:25 -0400, me wrote:

On 24 Mar 2008 16:02:42 GMT, in rec.photo.digital ray
wrote:


Actually, I have found that converting to DNG does quite well. And, of
course, DNG is supported already by photo editors, so no need to convert
back.
You can't, as DNG doesn't preserve 100% of the metadata.

Of course I can.


Not according to Adobe in:

Introducing the Digital Negative specification: Information for
Manufacturers:
http://www.adobe.com/products/dng/pd...ufacturers.pdf

"It should be noted that the Adobe DNG Converter will not necessarily
maintain all of the private metadata in certain camera-specific raw formats
because this information
is not publicly documented and therefore not available to Adobe. However,
the Adobe DNG Converter will maintain all of the original image data as
well as all of the metadata needed for a high-quality final conversion.
Arguably, the private metadata is not really archival, regardless of the
format used, simply because it is undocumented. Nevertheless, Adobe
recommends that, when photographers use the Adobe DNG Converter for
archival purposes, they should maintain both the resulting DNG file and the
original camera-specific file."


Note the words "not necessarily maintain....", certainly leaving room
for some RAW formats that have all data captured regardless.

--
John McWilliams
  #45  
Old March 25th 08, 12:35 AM posted to rec.photo.digital,rec.photo.digital.slr-systems
ray
external usenet poster
 
Posts: 2,278
Default 'extra' lossless compression for camera raw images

On Mon, 24 Mar 2008 19:15:29 -0400, me wrote:

On 24 Mar 2008 22:38:33 GMT, in rec.photo.digital ray
wrote:

On Mon, 24 Mar 2008 16:31:25 -0400, me wrote:

On 24 Mar 2008 16:02:42 GMT, in rec.photo.digital ray
wrote:


Actually, I have found that converting to DNG does quite well. And, of
course, DNG is supported already by photo editors, so no need to
convert back.

You can't, as DNG doesn't preserve 100% of the metadata.


Of course I can.


Not according to Adobe in:

Introducing the Digital Negative specification: Information for
Manufacturers:
http://www.adobe.com/products/dng/pd...ufacturers.pdf

"It should be noted that the Adobe DNG Converter will not necessarily
maintain all of the private metadata in certain camera-specific raw
formats because this information
is not publicly documented and therefore not available to Adobe.
However, the Adobe DNG Converter will maintain all of the original image
data as well as all of the metadata needed for a high-quality final
conversion. Arguably, the private metadata is not really archival,
regardless of the format used, simply because it is undocumented.
Nevertheless, Adobe recommends that, when photographers use the Adobe
DNG Converter for archival purposes, they should maintain both the
resulting DNG file and the original camera-specific file."


That's fine, but I can still use it if I damned well please!!
  #46  
Old March 25th 08, 10:50 AM posted to rec.photo.digital,rec.photo.digital.slr-systems
Wolfgang Weisselberg
external usenet poster
 
Posts: 5,285
Default 'extra' lossless compression for camera raw images

["Followup-To:" header set to rec.photo.digital.slr-systems.]
John McWilliams wrote:

You can't, as DNG doesn't preserve 100% of the metadata.

[...]
Note the words "not necessarily maintain....", certainly leaving room
for some RAW formats that have all data captured regardless.


True. But unless it is stated explicitely that for format X all
metadata is preserved, and that is proved by experimentation ...

-Wolfgang
  #47  
Old March 25th 08, 12:40 PM posted to rec.photo.digital,rec.photo.digital.slr-systems
[email protected]
external usenet poster
 
Posts: 222
Default 'extra' lossless compression for camera raw images

wrote:
On 24 Mar 2008 22:38:33 GMT, in rec.photo.digital ray
wrote:

On Mon, 24 Mar 2008 16:31:25 -0400, me wrote:

On 24 Mar 2008 16:02:42 GMT, in rec.photo.digital ray
wrote:


Actually, I have found that converting to DNG does quite well. And, of
course, DNG is supported already by photo editors, so no need to convert
back.
You can't, as DNG doesn't preserve 100% of the metadata.

Of course I can.


Not according to Adobe in:

Introducing the Digital Negative specification: Information for
Manufacturers:
http://www.adobe.com/products/dng/pd...ufacturers.pdf

"It should be noted that the Adobe DNG Converter will not necessarily
maintain all of the private metadata in certain camera-specific raw formats
because this information
is not publicly documented and therefore not available to Adobe.


Of course it is available: it's there in the file. Adobe's statement
is disingenuous. If Adobe does not funnly understand some part of
a file, they need merely copy it, as is, into their generic format
along with the info needed to put it back in the original format.


Doug McDonald
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'extra' lossless compression for camera raw images Sachin Garg[_2_] Digital Photography 52 March 25th 08 10:40 PM
Extra! Extra! Suicidal Terrorists Attack Cheney Near Chicago's O'Hare ASAAR Digital Photography 0 April 15th 07 07:21 PM
Help with compression research (Need sample images) Sachin Garg Digital Photography 8 January 31st 07 01:43 PM
question about using jpegtran for lossless compression of jpegs [email protected] Digital Photography 4 October 24th 06 10:55 AM
(Lossy) compression of 16bit images Alfred Molon Digital Photography 3 February 3rd 06 07:52 AM


All times are GMT +1. The time now is 07:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PhotoBanter.com.
The comments are property of their posters.