Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
03-21-2019, 02:17 AM - 1 Like   #1
Site Supporter
Site Supporter
BruceBanner's Avatar

Join Date: Dec 2015
Posts: 5,404
FastStone Image Viewer and extracting Jpg's from RAW DNG's

So lately I have been entertaining the idea of using RAW+ as a mode for my cameras. There are however drawbacks to using that mode that I won't get into now, but it appears to me that it's possible if just simply shooting RAW for you to always derive the Jpg from the shot (complete with the Jpg settings used at the time of the shot from a couple of ways), either;

a) Use the camera itself and upon Playback>Downward Arrow Press>Raw Development

or

b) Use third party software, such as FastStone Image Viewer (FSIV) to somehow extract a decent copy of the Jpg preview file from the RAW DNG.

Here's what I have discovered thus far, but would appreciate some additional guidance from those with more know-how.

So Far

Ok, so to test things I took a picture in RAW+ mode, and generated an image with a DNG of 48.7mb and Jpg counterpart of 19.4mb (L, *** sRGB etc). I was using this as a kind of reference.

When viewing the DNG file in FSIV it actually shows the Jpg Preview, you can tell this easily with a test such as setting the camera settings Custom Image to being monochrome (BW), that's what you will see on FSIV, not the actual colour RAW file like how LR would present.

Now if I simply go 'Save As' in FSIV it will generate only a smallish file sized Jpg. From my 48.7mb DNG file it spat out a 5.77mb Jpg file (not quite the 19.4mb Jpg version the camera managed in RAW+ mode).

But what's this? There seems to be some additional Save Settings we can mess around with for the Jpg 'Save As' with the FSIV program, problem is I don't know what half this stuff means (see screen shot below).


Can You Help?

Look at the screen shot below and the variables we can change, and let's run through them all as they all impact the File Size of what the Jpg will end up as (actually trumping the 19.4mb the camera manages to generate for the Jpg in RAW+ mode!).



Ok let's first look at 'Quality', no brainer, we can slide that sucker up from 90 to 100. The new file size is now 14.4mb just from that tweak alone. Is it worth it? That's something else to consider... but we shall move on and look at the other settings.

Under Advanced we see 4 options, lets start with 'Photometric', it seems to be on 'YCbCr', perhaps this is default? Should I click the pull down menu I see the following options;

RGB
Grayscale
YCbCr
CMYK
YCbCrK

Changing to each of these gives the following new file size (provided we have still kept the Quality slider at 100).

RGB = 37mb
Grayscale = 10mb (image turned monochrome, durr)
YCbCr = 14.5mb
CMYK = 56mb! (um wat? this Jpg is now more mb than the RAW? lolwot)
YCbCrK = 38.5mb

Ok, cool... what does all this mean? I have my camera color space set to being sRGB, is that relevant to this area?

Ok we shall leave it as default YCbCr for now. Next up we have that little 'Progressive' box to tick, so tick it I shall. It has now reduced the file size from 14.5mb down to 13.4mb, ok I'm going to untick that

Across from that we have 'Optimize Huffman", it seems to be ticked as default, I'm going to untick that and see what it does to the file size. Ok, that pushed the file up to 17.6mb. So I'm guessing 'Progressive' and 'Optimize Huffman' are both some kind of compression? I think I shall leave them off for now.

Lastly we have 'Color Subsampling', it's default is set at 'High (Smaller File Size)' so lets change that, what options do we have?

'Disabled (Better Quality)' = 24.4mb image (if using this mode).
'Medium' = 18.7mb image (if using this mode).
Or
'High (Smaller File Size) = which gives us our aforementioned 17.6mb file.


So... that seems to be about it, but we can take DNG file and extract a hefty Jpg via FSIV, and we can do batch files Saves/Converts as well.

Would anyone like to weigh in with their thoughts on all this and the options and what we should perhaps set things at?

Summary

It might be that I decide to shoot RAW only and leave RAW+ alone, so that I don't hit possible buffer/write issues when on a job. Once the job is done I could always do a batch conversion of my RAW files and 'extract' those Preview Jpgs that the DNG's seem to have and get a size close to what the camera would generate. Then work on the Jpgs from editing perspective with RAW files still there if I need them. It's simply a case of how quickly I want those Jpgs, as I take the shot or at a later time at the computer and after I run a batch conversion.


Cheers,

Bruce

03-21-2019, 04:40 AM - 1 Like   #2
Veteran Member




Join Date: Jun 2009
Posts: 11,913
QuoteOriginally posted by BruceBanner Quote
Use third party software, such as FastStone Image Viewer (FSIV) to somehow extract a decent copy of the Jpg preview file from the RAW DNG.
The JPEG preview included in the DNG or PEF RAW is only a small dimension JPG rendering - eg a K-3 6000x4000 pixel image DNG has a 50kb 720x480 pixel JPEG preview image embedded in it. You have to be sure that Faststone isn't just working off that.

Also for working with RAWs in Faststone make sure your setup is Faststone: Menu>Settings>View RAW files in: > Actual Size (slow). Ditto for 'Batch convert RAW files'. That might avoid Faststone working off the mini previews.
03-21-2019, 04:49 AM   #3
Moderator
Loyal Site Supporter
Loyal Site Supporter
pschlute's Avatar

Join Date: Mar 2007
Location: Surrey, UK
Photos: Gallery
Posts: 8,188
Can't help with the Fastone settings I am afraid.

But a couple of points. The jpeg preview that is embedded in a raw file, is there so that the camera can display the image on the lcd screen. It also enables photo viewer apps to display a preview of the raw image. Raw files themselves DNG or PEF are not image files.

If you want to create a jpeg from a raw file, then you can use any raw converter to do so. If you want that jpeg to replicate the jpeg camera settings that were used when you took the shot, then you can do so with any raw converter that supports the Pentax profiles. Pentax camera utility is the obvious first choice, but Lightroom and Photoshop can do the same.

Hopefully someone else can chime in with a detailed description of those settings. But I would be wary of equating the output file size to quality. My recent portraits of Rio had 40MB raw files, and converting them to full size (7360*4912) jpegs using Silkypix DS Pro with a quality setting of 97% gives me a 5MB file.
03-21-2019, 05:15 AM   #4
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
Are you sure Faststone is extracting the built-in jpeg previews and not generating new ones? There are programs that will extract these previews "as is", I've used "Instant JPEG from RAW", but depending on your use they might be unsuitable. The camera will generate a full resolution preview, but it adjusts the jpeg compression level and aims to keep the file size below a set amount. On my k5iis, the full sized preview was something like 1mb. Depending on the image content, you might end up with very noticeable compression artifacts.

What is your use for these jpegs?

As to faststone's options:

Quality level- there is a huge amount of diminishing returns in the higher quality levels. There is a great discussion and interactive examples from Lightroom here Jeffrey Friedl's Blog » An Analysis of Lightroom JPEG Export Quality Settings. Do note that Lightroom's quality levels don't line up with Faststone's but the general principle is the same (the highest quality settings start to give little quality improvement for a massive amount of file bloating).

Photometric- changes how the colours are encoded in the jpeg. I've never fiddled with these, YCbCr is the norm as far as I know for photos and works well with the colour subsampling and human vision.

Progressive- see here What is a progressive JPEG? | Liquid Web Knowledge Base will make a little difference in how they are displayed on the web as the image is loading. Has a minor effect on the filesize, but nothing to write home about.

Optimize Huffman - keep this ticked. It makes the non-lossy part of the jpeg compression more efficient at the cost of a bit of time during the initial compression.

Color Subsampling - "Medium" is generally fine for screen use, sometimes 'High" is ok too. It depends on the content.


Best bet? Make a sample set of a dozen or so images covering a range of image content. Run them through your program of choice in batches with different settings. Find out what works for you.


Last edited by BrianR; 03-21-2019 at 05:39 AM.
03-21-2019, 06:18 AM - 2 Likes   #5
Veteran Member




Join Date: Jun 2009
Posts: 11,913
Simple option - as used by me

- shoot RAW (DNG);
- use Lightroom (or DxO or C1 or PDCU) to do your output conversions to JPEG.

I love Faststone, but only use it for quick JPEG or TIFF adjustments, one or two occasional clone and heals, and batch reductions/ watermarking. Not as my main RAW converter.
03-21-2019, 06:38 AM   #6
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
QuoteOriginally posted by rawr Quote
The JPEG preview included in the DNG or PEF RAW is only a small dimension JPG rendering - eg a K-3 6000x4000 pixel image DNG has a 50kb 720x480 pixel JPEG preview image embedded in it. You have to be sure that Faststone isn't just working off that.
The RAWs will have embedded full resolution jpeg previews. I just downloaded and checked a couple K-1 files using "Instant Jpeg From Raw" and it extracted full resolution (4912x7630 pixels) files that were about 4MB. Compression varied depending on content, JPEGSnoop approximated one to a Quality setting of 76 in Faststone.

QuoteOriginally posted by rawr Quote
Also for working with RAWs in Faststone make sure your setup is Faststone: Menu>Settings>View RAW files in: > Actual Size (slow). Ditto for 'Batch convert RAW files'. That might avoid Faststone working off the mini previews.
QuoteOriginally posted by BrianR Quote
Are you sure Faststone is extracting the built-in jpeg previews and not generating new ones?
Ah right, I forgot about that setting. It looks like the "Save As" option always works off the RAW file and not the embedded preview, but the "Batch Convert" respects the option you mentioned. I agree that it's a bad idea to use the batch convert to re-compress a bunch of jpeg preview files that might already be of sketchy quality. It does take about half the time though (Instant JPEG from RAW is almost instantaneous, and would be a better option if it was the previews someone was after).
03-21-2019, 07:11 AM   #7
Site Supporter
Site Supporter




Join Date: Nov 2012
Location: North Wales
Photos: Gallery | Albums
Posts: 2,868
To edit the full sized RAW in Faststone, first press "A" letter key. You will see the full sized RAW file load.

03-21-2019, 07:41 AM   #8
Veteran Member




Join Date: Jun 2009
Posts: 11,913
QuoteOriginally posted by BrianR Quote
The RAWs will have embedded full resolution jpeg previews.
Not from what EXIFTOOL reveals:

QuoteQuote:
Image Size : 6080x4032
Lens ID : smc PENTAX-DA 18-135mm F3.5-5.6 ED AL [IF] DC WR
Megapixels : 24.5
Preview Image : (Binary data 51580 bytes, use -b option to extract)
This preview, as it turns out, is not a 6000x4000 image.
03-21-2019, 07:57 AM - 1 Like   #9
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
QuoteOriginally posted by rawr Quote
Not from what EXIFTOOL reveals:

This preview, as it turns out, is not a 6000x4000 image.
There are multiple preview images. I've tested on k3 raws I've downloaded from Imaging resources, and IJFR finds full resolution ones. What options are you using for exiftool? It may not be finding all of the previews or is defaulting to the smallest.
03-21-2019, 08:21 AM   #10
Veteran Member




Join Date: Jun 2009
Posts: 11,913
QuoteOriginally posted by BrianR Quote
What options are you using for exiftool?
In this case, I'm just using EXIFTOOL GUI v4, and hitting menu>Export/Import from selected DNG files. The tiny files are consistent with other apps that can extract the JPEG previews, and the previews match the tiny file size EXIFTOOL reports.

There is no reason for the JPEG previews to be full resolution (eg 6000x4000 pixels), otherwise they would hardly be previews, so I have confidence in what is revealed here. (IIRC Xnview can also pop out the same size JPEG previews).
03-21-2019, 08:30 AM   #11
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
QuoteOriginally posted by rawr Quote
In this case, I'm just using EXIFTOOL GUI v4, and hitting menu>Export/Import from selected DNG files. The tiny files are consistent with other apps that can extract the JPEG previews, and the previews match the tiny file size EXIFTOOL reports.

There is no reason for the JPEG previews to be full resolution (eg 6000x4000 pixels), otherwise they would hardly be previews, so I have confidence in what is revealed here. (IIRC Xnview can also pop out the same size JPEG previews).
Hmm, I just tried exiftool gui v4.2.0.0 and only have the options to export from cr2 or nef, I will update and try again. I say again- Instant Jpeg from Raw finds full sized previews, so no, the tiny files are not consistent with other programs. If all the camera has are 720x480, how would you zoom in without immediate pixellation on the back of the LCD?

Edit- updated exiftool gui to 5.16.0.0 and extracted a 6016x4000 pixel 3mb preview image from a k3 pef file.

Last edited by BrianR; 03-21-2019 at 08:42 AM.
03-21-2019, 08:46 AM   #12
Veteran Member




Join Date: Jun 2009
Posts: 11,913
QuoteOriginally posted by BrianR Quote
I say again- Instant Jpeg from Raw finds full sized previews, so no, the tiny files are not consistent with other programs.
Most RAW viewers - like Faststone- use dcraw at the backend. 720x480 is big enough for previews on the rear displays of cameras.

Maybe lurking in the RAW, unprocessed files of every camera that shoots PEF or DNG there is a whole set of pre-processed JPEG previews, inc full-size. But I don't think they need to be there, so they probably aren't.
03-21-2019, 08:53 AM   #13
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
QuoteOriginally posted by rawr Quote
Most RAW viewers - like Faststone- use dcraw at the backend.
I'm not sure of your point?

QuoteOriginally posted by rawr Quote
720x480 is big enough for previews on the rear displays of cameras.
Not if you zoom in it isn't.

QuoteOriginally posted by rawr Quote
But I don't think they need to be there, so they probably aren't.
Then where are they coming from if both IJFR and ExifTool can find them?

edit- try entering "-preview:all" in exiftoolgui's "Exiftool Direct" window, my sample k3 pef shows 3 different sized embedded previews, one ~3MB (Jpg From Raw), one ~50k (Preview Image), and one ~7k (Thumbnail Image).

Last edited by BrianR; 03-21-2019 at 09:04 AM.
03-21-2019, 10:49 AM   #14
Otis Memorial Pentaxian
stevebrot's Avatar

Join Date: Mar 2007
Location: Vancouver (USA)
Photos: Gallery | Albums
Posts: 42,007
QuoteOriginally posted by rawr Quote
This preview, as it turns out, is not a 6000x4000 image.
QuoteOriginally posted by BrianR Quote
There are multiple preview images. I've tested on k3 raws I've downloaded from Imaging resources, and IJFR finds full resolution ones. What options are you using for exiftool? It may not be finding all of the previews or is defaulting to the smallest.
This is a complicated issue in regards to the preview images in Pentax DNG and PEF. Neither dcraw or ExifTool is able to extract all the files supposedly there. There is definitely a full resolution JPEG embedded. It is used for the 100% viewing on the rear LCD. Whether there is a highest quality version is a matter of dispute. I know of no one who has successfully done the extract.

BTW...in regard to the 6080x4032 file...the 6016x4000 image size in the K-3 specification is nominal. The actual capture has addition rows and columns on the edges that are cropped off during processing.


Steve
03-21-2019, 11:17 AM   #15
Veteran Member




Join Date: Dec 2010
Location: Ontario
Photos: Gallery
Posts: 3,332
QuoteOriginally posted by stevebrot Quote
This is a complicated issue in regards to the preview images in Pentax DNG and PEF. Neither dcraw or ExifTool is able to extract all the files supposedly there. There is definitely a full resolution JPEG embedded. It is used for the 100% viewing on the rear LCD. Whether there is a highest quality version is a matter of dispute. I know of no one who has successfully done the extract.
Exiftool can extract the full resolution preview, in ExifToolGui use "-b -jpgfromraw -w filename.jpg". So can Instant Jpeg From Raw. This is the one used for the magnified view on the rear LCD (do it and check, you can compare the 8x8 jpeg block artifacts).

Last edited by BrianR; 03-21-2019 at 11:29 AM.
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
camera, crop, dng, faststone, file, files, folder, fs, image, images, jpg, jpgs, mode, pdcu, photography, photoshop, quality, res, shot, size
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
K-70 "This image cannot be displayed" when DNG converted to JPG in Photoshop CS5 Wolfeye Pentax K-70 & KF 3 12-08-2016 02:40 PM
Pixel Shift single image extraction from RAW using Fast Stone Image Viewer rgknief60 Pentax K-1 & K-1 II 3 08-18-2016 02:37 PM
K-S2 JPG's versus K5ll JPG'S and K50 JPG's LoneWolf Pentax DSLR Discussion 22 03-28-2015 12:58 PM
Display both RAW/DNG and the JPG DavidSKAF3 Troubleshooting and Beginner Help 2 02-04-2015 02:34 AM
Problem comparing images in FastStone Image Viewer altopiet Digital Processing, Software, and Printing 2 10-18-2012 11:34 PM



All times are GMT -7. The time now is 03:37 PM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top