JPG to raw? Yes.

Discussion in 'Digital SLR' started by Alan Browne, Jan 8, 2011.

  1. Alan Browne

    Alan Browne Guest

    Some time ago there was debate here about the possibility that one could
    convert from JPG to raw. Some said, "no it can't be done - you can't
    "re" mosaic from an interpolated file."

    And while in a pure mathematical sense, that is true, I (and others)
    pointed out that one could still generate a very close approximation to
    a raw from a JPG.

    Lo and behold, it appears that Adobe have a program called "toDNG" which
    takes a JPG and generate a DNG (a raw container format).

    What I find odd is that this program is not available from the Adobe
    site, but is available for $5.99 from the Apple Apps store.
     
    Alan Browne, Jan 8, 2011
    #1
    1. Advertisements

  2. Alan Browne

    Guest Guest

    it can't.
    not really. you can't get back what is lost in jpeg. you may be able to
    apply a bayer mask to fake it, but that's not what one would call a
    'very close approximation' of the original raw data.
    it's not adobe (see below) and all it does is convert the jpeg to
    linear dng (not raw dng, which is what you may be thinking of).

    it's not 'raw' like what came out of the camera, nor is the jpeg
    re-mosaiced.

    his description is also misleading. you don't need to convert to dng to
    be able to do non-destructive editing. you can easily do that on a jpeg
    with lightroom and probably other apps too. he also neglects to mention
    that apple's aperture doesn't support linear dng.
    that's because it's not adobe's program, it's by someone named sandy
    mcguffog.

    <http://sites.google.com/site/todngsite/>
     
    Guest, Jan 8, 2011
    #2
    1. Advertisements

  3. Alan Browne

    Alan Browne Guest

    Typical of you to insert responses before it's addressed in the next
    sentence of the text.
    Of course you can. It's no different than a lot of approximations in
    math in non reversible conversions. Non-square matrix inversions, for
    one typical example, where inverting one way cannot invert back to the
    original because some information is lost. The amount of loss is
    minimal. eg: "very close".
    Yes, I found out it's not Adobe - I was misled by the logo that
    resembles the Adobe DNG logo.
    And of course it's not "the same" as described above. Why you point out
    differences that have already been pointed out in a point scoring manner
    is either baffling or indicative.

    Of course it's "re-mosaic'd". That is the nature of the raw container.
    I wasn't commenting on his claims. Only that you could, if desired, get
    back to a raw format from JPG.
     
    Alan Browne, Jan 9, 2011
    #3
  4. Alan Browne

    John A. Guest

    Absolutely true, in the context in which it was originally discussed:
    whether possession of a RAW version of an image is proof-positive of
    ownership enough without a forensic examination of the RAW.

    No, you can't restore a lost RAW from a jpeg. But you can, in theory
    even if nobody has made a utility to fully do it yet, create a RAW
    from a jpeg that will probably pass a cursory look. That's all that's
    being claimed here.

    The utility cited here may well be enough for many cases. Someone who
    believes RAWs simply cannot be made from jpegs may well take the mere
    presence of an openable RAW as proof enough, particularly if it's
    filled in with fake EXIF data.

    At this point, were I running an image posting site where ownership of
    a user-posted image was being challenged, I would still take
    possession of a RAW image as proof of ownership since the vast
    majority of folk probably don't know it can be done, but would now
    take challenges to that proof seriously if the poster makes them.
     
    John A., Jan 9, 2011
    #4
  5. Alan Browne

    Alan Browne Guest

    While I'm sure the resultant raw is of good quality, at least to that of
    the JPG it comes from (I'm not willing to spent $6 to find out - why
    there are not trial periods on these Mac Apps, I'm not sure...) I'm also
    sure that the resultant raw could quickly be determined as a derivative.
    Either by steps in DR (assuming it encodes to more than 8 bits) or by
    the EXIF that is inserted, whether that of the JPG, the utility or both.
     
    Alan Browne, Jan 9, 2011
    #5
  6. Alan Browne

    Guest Guest

    it's not close at all, nor does it matter because that's not what this
    utility even does.
    it's *not* re-mosaiced.

    all this app does is convert a jpeg to a linear dng, which is basically
    an rgb pixel map. learn what the difference is versus a raw dng before
    you spout.

    <http://www.adobe.com/support/downloads/detail.jsp?ftpID=4368>

    A linear DNG file has gone through a demosaic process that converts a
    single mosaic layer of red, green and blue channel information into
    three distinct layers , one for each channel. The resulting linear
    DNG file is approximately three times the size of a mosaic DNG file
    or the original proprietary file format.

    the jpeg has already gone through the demosaic process, so converting
    it to a linear dng is actually very straightforward.
    no, you cannot, nor does he even claim that it converts it back to raw.
    he just carefully phrased the description to suggest that it does.

    he leads with the question "Got a JPEG that you wish you could convert
    into raw format?" and then says "toDNG converts very nearly any bitmap
    file to a DNG (Digital Negative) file quickly and easily, with colors
    exactly like the original"

    converting to dng doesn't mean it converts into raw. he's answering a
    question that was not asked. that's deceptive.

    he also says 'linear raw dng,' something that does not even exist. dng
    files are either linear or raw, not both. in this case, it's a linear
    dng, and by saying linear raw dng, he's being intentionally misleading.

    there is no advantage to converting a jpg to a linear dng, and worst of
    all, he has the gall to charge $6 for it.
     
    Guest, Jan 9, 2011
    #6
  7. Alan Browne

    Alan Browne Guest

    1) That paragraph does not appear on the page you link to. The correct
    link is:
    http://www.adobe.com/special/photoshop/camera_raw/DNG_5.3_Converter_ReadMe.pdf
    , page 5.

    2) The above paragraph is not universal. It applies to a small subset
    of cameras, (Panasonic, Leica). The portion of the paragraph you, er,
    ahem, conveniently left out is:

    ** There is an important exception in our DNG file handling for the
    Panasonic DMC LX3, Panasonic DMC FX150, Panasonic DMC FZ28,
    Panasonic DMC-G1 and Leica D-LUX 4. For those choosing to convert
    these native, proprietary files to the DNG file format, a linear
    DNG format is the only conversion option available at this time.

    Followed by what you wrote above as part of the same paragraph.
    That's not supported by what you wrote above, which a) is an Adobe
    document referring to 4 specific camera models nor b) what the actual
    model the App in hand uses.
    It makes a DNG; which is a container for a TIF. That is how DNG
    represents a raw ... in a format (TIF) that was not historically a raw
    format, just a higher DR format that Adobe adapted to contain raw data.
    You'd have to examine the contents of the DNG. See above.
    raw is linear by definition. Linear means no gamma applied. That is
    how I read "linear" above. Not in relationship to vert/horiz geometry.
    Only to those who buy it. I'd DL it for testing if there was a trial
    period.
     
    Alan Browne, Jan 9, 2011
    #7
  8. Alan Browne

    Savageduck Guest

    OK! I have LR2 and I must be missing something.
    Importing a jpeg into LR2 gives me a dialog warning that "Only RAW
    camera files were converted to DNG."
    < http://homepage.mac.com/lco/filechute/LR2-DNG-01.jpg >
    I have yet to find a way of creating a DNG from a JPEG using Adobe
    software. If you know something I don't, please educate us.

    There is of course nothing stopping you from saving a jpeg (with or
    without 8-16 bit mode change) as a Photoshop RAW (PRAW). However there
    is a file size penalty 8.8MB jpeg becomes a 73.4 MB PRAW and a
    disclaimer from PS in the dialog.
    "The Photoshop Raw file format does not fully encode the image mode and
    size, among other things. The image may not be fully restored when you
    re-open the file."
    < http://homepage.mac.com/lco/filechute/PS-PRAW-SD-01.jpg >
     
    Savageduck, Jan 9, 2011
    #8
  9. Alan Browne

    Guest Guest

    OK! I have LR2 and I must be missing something.
    Importing a jpeg into LR2 gives me a dialog warning that "Only RAW
    camera files were converted to DNG."
    < http://homepage.mac.com/lco/filechute/LR2-DNG-01.jpg >
    I have yet to find a way of creating a DNG from a JPEG using Adobe
    software. If you know something I don't, please educate us.[/QUOTE]

    import the jpeg as you would normally, select it and export to dng.

    <http://livedocs.adobe.com/en_US/Lightroom/1.0/help.html?content=WS450D1
    32D-9820-4ea8-902A-ED08CEBD95FF.html>

    DNG (digital negative) export options

    ...Choose Convert To Linear Image to store the image data in an
    interpolated (demosaiced) format. The resulting image can be
    interpreted by other software even if that software doesn¹t have a
    profile for the digital camera that captured the image.
    that's a different type of raw. photoshop raw is basically just a dump
    of the pixel map data.
    yep, to open a photoshop raw, you need to know the x/y dimensions, how
    many channels of data, bit depth, etc. if you don't have it exactly
    correct, you get very interesting results.
     
    Guest, Jan 9, 2011
    #9
  10. Alan Browne

    Alan Browne Guest

    So it does.
    You snipped it because it made the rest of the paragraph apply to 4 or 5
    specific cameras and made the rest of your argument misleading and
    useless (except where those 5 cameras (4 Panasonic, 1 Leica) were
    concerned).
     
    Alan Browne, Jan 9, 2011
    #10
  11. Alan Browne

    Savageduck Guest

    import the jpeg as you would normally, select it and export to dng.

    <http://livedocs.adobe.com/en_US/Lightroom/1.0/help.html?content=WS450D1
    32D-9820-4ea8-902A-ED08CEBD95FF.html>

    DNG (digital negative) export options

    ...Choose Convert To Linear Image to store the image data in an
    interpolated (demosaiced) format. The resulting image can be
    interpreted by other software even if that software doesn¹t have a
    profile for the digital camera that captured the image.[/QUOTE]

    OK!
    That worked, and I got a DNG from a 7.6MB JPEG. However the resulting
    DNG was 22.3MB. Kind of makes you wonder if saving editied and
    processed output as a PSD isn't a better option since true RAW is not a
    reality.

    In this case the original, out of D300s NEF was 19.2 MB, and the LR2
    converted NEF to DNG was 9.5MB.

    Yup!
     
    Savageduck, Jan 9, 2011
    #11
  12. Alan Browne

    Paul Furman Guest

    I just tested in Lightroom in the export dialogue, and it turns a 4.6MB
    jpeg into a 21MB DNG. Real raw DNGs are usually around 8MB to 12MB.
    Exporting to 16 bit TIFF makes a 61MB file and 8 bit TIFF makes a 29.8MB
    TIFF... odd the 'fake' DNG is smaller that a TIFF.

    The only reason I can think of wanting this (apart from deception) would
    be if you almost always archive DNG but occasionally only have a jpeg
    original and just prefer to have it appear as the same format so it
    isn't mistaken for a throw away jpeg experiment. There is no harm other
    than size penalty, actually somehow there is a little size savings over
    uncompressed TIFF.

    4.6 MB JPG
    21 MB DNG from the JPG
    8 MB to 12MB raw DNG
    61 MB 16 bit TIFF
    29.8 MB 8 bit TIFF
    18 MB 8 bit TIFF with LZW compression

    In order to re-mosaic for any useful purpose, you'd have to invent the
    added dynamic range that spec contains, which then wouldn't really be
    useful.
     
    Paul Furman, Jan 9, 2011
    #12
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.