DNG Converter: What is the command line option for lossy compression?

  • 4
  • Question
  • Updated 5 years ago
  • Answered
What is the command line option for lossy compression?

And for the sake of completeness, command-line option for fast-load data?

These two tidbits would allow me to get by until documentation is formally updated.

Thanks,
Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes

Posted 7 years ago

  • 4
Photo of Greg W

Greg W

  • 3 Posts
  • 0 Reply Likes
Has there been any update to the documentation?
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
No - and I'm about to lose my mind.

Delay of X weeks? a few months? - understandable, acceptable, ...

But it's been almost a year now! - come on Adobe - it's just a few lines in a pdf!!!

Adobe, please, for God's sake - take a half second and update your documentation!!!!!!!!!!!! - it's long overdue.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
From reverse engineering + trial/error, I have figured out that the command-line switch

-lossy

will create lossy DNG, but I haven't figured out how to reduce rez yet. I expected

-size
-count

to do it, but so far no go.

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
In addition to the inability to resize raws for lossy dng, I also can't seem to get Adobe DNG Converter to wrap a jpeg.

These two functions are critical for my application.

Adobe - please document.
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 625 Posts
  • 129 Reply Likes
Official Response
There are two command-line options to control image size for lossy compression. You can use -side to specify the maximum number of pixels on a side. Similarly, you can use -count to specify the maximum number of pixels total. Both of these options imply using lossy compression.

Example 1:

./Adobe DNG Converter -side 2000 MyRawFile.NEF

produces a lossy compressed DNG that is limited to 2000 pixels on the long side.

Example 2:

./Adobe DNG Converter -count 10000000 MyRawFile.NEF

produces a lossy compressed DNG that is limited to 10 MP total.

Example 3:

./Adobe DNG Converter -lossy MyRawFile.NEF

produces a lossy compressed DNG that has the same pixel dimensions as the input.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
perfect. - thank you.

(-side, not -size - oops/duh: operator error...)
Photo of Greg W

Greg W

  • 3 Posts
  • 0 Reply Likes
SO EXCITED to go into the office tomorrow and try this out. Thanks Eric!
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
Conversion of raws to lossy dng is working perfectly for me :-).

I'd like to be able to wrap jpegs, and know the rest of the command-line parameters, like fast-load, but at least the some of the most important pieces are now in place, thanks to Eric..
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 625 Posts
  • 129 Reply Likes
You can use the -fl switch ("fl" for "fast load") to enable embedding of Fast Load Data into the output DNG file.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
Thanks again Eric. - "fast load" option is now incorporated too!
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 625 Posts
  • 129 Reply Likes
And, I believe (at present) there isn't an option to get DNG Converter to include JPEGs. I'll check into that.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
I'll be standing by... - said feature would be worthwhile.

I was considering accomplishing via export (Lr), but that won't be acceptable, since it will result in an extra photo in the catalog (I need conversion prior to import, or else enhanced SDK functionality to support post-import conversion...).
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
Well, what's the word?

I've assumed the option does not exist, and made a feature request for it here:

http://feedback.photoshop.com/photosh...
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
PS - I can get by without the command-line switch for fast-load data (is it supported via command-line?) for the time being, although I still think it would be worthwhile to update the command-line documentation... - thanks.
Photo of Pedro Marques

Pedro Marques

  • 165 Posts
  • 26 Reply Likes
The manual of command lines available is incomplete yet.

Someone from Adobe, please update the pdf file.
http://wwwimages.adobe.com/www.adobe....
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
I've been futzing around with this since, like everyone else, I was disappointed by the out-of-date manual from Adobe. As best I can tell the options are as follows:

-o - output file
-d - output directory
-l - Linear file
-e - embed original raw file
-cr2.4 - Set to Camera Raw 2.4 compatibility
-cr4.1 - Set to Camera Raw 4.1 compatibility
-cr4.6 -...
-cr5.4
-cr6.6
-cr7.1
-dng1.1 - Set to DNG spec. 1.1
-dng1.3 - Set to DNG spec. 1.3
-dng1.4 - Set to DNG spec. 1.4
-u - uncompressed
-lossy - lossy compression
-side - pixel count for longest side
-count - byte count for image size (Min 1024 pixels as best I can tell)
-p0 - no JPEG preview
-p1 - Medium JPEG preview
-p2 - Full size JPEG preview
-x - it's there, it takes some form of parameter (e.g. -x1) but I have no idea what it does :~|

Note that -side and -count will downsample but not upsample the images (I guess that was too much to hope for).

I hope this helps. YMMV

Nick
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
There's also:

-fl - fast-load data
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
BTW. I did not find -fl in the binary when I looked so I suspect it may have been deprecated in the latest version.
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
Hmmmmmm ... On a whim I tested the -fl and the resulting file is, indeed, larger. I wonder what other options are hidden in there that I have yet to uncover ...
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
'bout time for that document if you ask me - it's just one sparse page.
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
I second that motion
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
Dunno why -fl wouldn't appear in the binary, nor why Adobe has neglected the documentation.
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
I'm using the strings command to find these options. I wonder if the string -fl is too short to show up? I tried the option and it definitely changed the behavior. The resulting dng file was 300kb larger than before - 6.6Mb vs 6.3Mb. Most of the command line options are in a single block of the binary - very common since they are all referenced in one block of code - but there are some omissions that I found through brute force such as -x.

The ball really is in -Adobe's court.

N
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
Adobe DNG Converter(1) Adobe DNG Converter(1)

NAME
Adobe DNG Converter

OVERVIEW
Due to a lack of documentation from Adobe this man page is being
reverse engineered from the collected knowledge of users and strings on
the binary. Sorry if Adobe doesn’t like it ‐ they can help us by docu‐
menting the app.

DESCRIPTION
Adobe DNG Converter is a GUI app that converts camera raw files to the
more universal format Digital Negative ‐ DNG file. The app provides a
self explanatory GUI but also has a set of command line features for
inclusion into batch processes. This man page sets out to document
those latter functions and assumes the reader is largely familiar with
the basic function of the app.

AUTHOR
Adobe DNG Converter was written by a team within Adobe. As of the cur‐
rent version the members are listed in the About DNG Converter in the
GUI.

AVAILABILITY
Adobe DNG Converter is freely available for download from Adobe’s web‐
site www.adobe.com

INVOCATION
The app can, of course, be run from the desktop as a GUI application.
Command line invocation is as follows:
‐ Mac: /Applications/Adobe\ DNG\ Converter/Con‐
tents/MacOS/Adobe\ DNG\ Converter.app [options]
(source_file|source_directory)
‐ PC: ...

Options
The following flags are interpreted by the app when invoked:

‐count byte count for image size (Min 1024 pixels as best I can tell)

‐cr2.4 Set to Camera Raw 2.4 compatibility

‐cr4.1 Set to Camera Raw 4.1 compatibility

‐cr4.6 ‐...

‐cr5.4

‐cr6.6

‐cr7.1

‐d output directory

‐dng1.1
Set to DNG spec. 1.1

‐dng1.3
Set to DNG spec. 1.3

‐dng1.4
Set to DNG spec. 1.4

‐e embed original raw file

‐fl Include fast‐load information

‐l Linear file

‐lossy lossy compression

‐o output file

‐p0 no JPEG preview

‐p1 Medium JPEG preview

‐p2 Full size JPEG preview

‐side pixel count for longest side

‐u uncompressed

‐x it’s there, it takes some form of parameter (e.g. ‐x1) but I
have no idea what it does :~|

COMPATIBILITY
SEE ALSO
Adobe DNG Converter 8.4.0.199 June 9, 2014 Adobe DNG Converter(1)
Photo of Nick Seth-Smith

Nick Seth-Smith

  • 10 Posts
  • 4 Reply Likes
$0.02
Photo of Chris Castleberry

Chris Castleberry, Camera Raw Engineer

  • 376 Posts
  • 114 Reply Likes
FYI, the documentation has been updated.

http://wwwimages.adobe.com/content/da...
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 386 Reply Likes
Adobe: thank you.
Chris: thank you too.

Although the documentation had pretty-much been cobbled together by users like Nick (thank you 3), having official documentation is very comforting (or conversely: *not* having officially updated documentation makes it seem like a dead/unsupported product/feature) - thanks again to Adobe.
Photo of Chris Castleberry

Chris Castleberry, Camera Raw Engineer

  • 376 Posts
  • 114 Reply Likes
Thanks, Rob.

DNG converter is alive and well, including the command line interface.

We'll try to do a better job of keeping it current. :)