Author Topic: Closed: Crop marks shown on image preview that is already cropped  (Read 5277 times)

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
I noticed that PM sometimes still shows crop marks for images (dng files) that already have the crop applied to them (embedded preview has been updated). The strange thing is that this does not always occur; most of the images that have had their crop applied are fine and show no crop marks, but once in a while I get a stubborn image. Even stranger: sometimes removing the crop and then reapplying it (in ACR) works, but not always…

Any ideas?
« Last Edit: April 25, 2019, 08:20:17 AM by Hayo Baan »
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Crop marks shown on image preview that is already cropped
« Reply #1 on: March 20, 2014, 01:28:01 PM »
Hayo,

Maybe you can FTP us a sample "stubborn" DNG?  Are you drawing a crop with the same aspect ratio as the photo (e.g. 3x2 for landscape or 2x3 for portrait)?  It would be useful to have both DNGs before and after crop.

I assume you have the FTP incoming info?

Regards,

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Crop marks shown on image preview that is already cropped
« Reply #2 on: March 21, 2014, 01:55:57 AM »
Hi Dennis,

I just uploaded a sample file called 20140210_Crop.dng.

I'm not sure what you meant by before and after, but to reproduce this is easy (I just tried again):
1. Open the file in ACR (I'm on 8.3 using Photoshop CC)
2. Remove the crop
3. Save it (make sure your settings are such that it updates the full preview jpg)
4. Verify in PM that you have the whole preview without crop marks shown
5. Edit file again in ACR and add a 3x2 crop (removing just a tiny bit around the edges)
6. Save it
7. PM will now show the crop marks even though the preview already has the crop applied…

As I mentioned, the problem of the crop marks showing is not consistent, I would say that 9 out of 10 times this isn't a problem at all…
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Crop marks shown on image preview that is already cropped
« Reply #3 on: May 06, 2014, 12:26:15 PM »
Hi Dennis, did you already have a chance to look at this one?

It happens quite frequently and I really would like this fixed (or at least be able to have PM not show the crop box at all so I can look at the images without obstruction…)
« Last Edit: May 06, 2014, 12:27:56 PM by Hayo Baan »
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Crop marks shown on image preview that is already cropped
« Reply #4 on: May 09, 2014, 01:58:32 PM »
Hayo,

This issue is tricky and it also was a problem with CNX-2, which I guess should no longer a problem for you now that you have moved on to Adobe's workflow ;).  But I will explain CNX-2 issues since you are familiar with that workflow and the problem you are having with DNG's is similar.

First let me explain that PM stores potentially two crops for RAW files.  There is the "main" crop which is stored in XMP in the camera raw (ACR) namespace.  This main crop applies to the full resolution RAW file.  Additionally there is a draft crop in PM which I'll explain below.

Now for RAW files that haven't yet been touched by other applications (e.g. before editing a NEF in CNX-2), the embedded preview should represent the full RAW image even though it could be a smaller dimension (e.g. Canon used to embed small JPEG previews, whereas Nikon has embedded full resolution previews for a long time).  In this case when PM draws the "draft" image of a RAW file it can apply this main crop to the draft preview.  So PM's "draft crop" can inherit the main crop because the preview is representative of the full resolution RAW image.  Alternatively, when you draw a crop in PM on this draft preview, the main crop will inherit this draft crop.  The two crops are "joined" when the preview is representative.

If you are on a Mac and your ImageIO version supports your camera RAW files (e.g. Apple's Preview can display them), then you can use the Q key in PM's preview window to render the RAW using ImageIO.  In this case PM will always use the main crop (if any) because you are looking at the full RAW file.  If you draw a crop in the RAW mode, and the preview is representative of the full RAW image, then the draft crop will inherit the main crop.  Remember the crop is stored as a fraction of the image size, not absolute pixels.

So everything is fine until… you edit the NEF file in CNX-2, crop the NEF, then save a new NEF.  In this case CNX-2 will update the preview in the RAW file (I wish it wouldn't) to show the cropped image (i.e. it removes anything outside the crop).  Of course CNX-2 knows nothing about XMP crops in the ACR namespace, so as far as another application like PM is concerned, the crop will still exist in the XMP and PM should assume the RAW file has a crop.  Unfortunately, this crop really only applies to the main, full resolution image and should no longer apply to the already cropped draft preview that CNX-2 updated.

But how is PM to know if the user cropped the NEF file in CNX-2?  Because if the user did crop, then PM shouldn't be drawing this XMP ACR "main" crop on the draft preview anymore.  However, PM should still draw this main crop if the user renders the RAW file (if possible on Mac) using the Q key.  How can PM know if the embedded preview has been cropped?

When PM looks at the preview in a raw file, it needs to determine whether or not this preview represents the full resolution RAW image.  But there wasn't a way (that I could tell with available and reliable metadata) whether or not a user had cropped in CNX-2 (short of white-listing all models with their dimensions).  So PM will look at the aspect ratio (width/height) of the embedded preview.  If this aspect ratio is different from the aspect ratio of the RAW file (basically 3:2 for NEF), then PM will determine that the preview "draft" isn't representative of the the RAW file.  Therefore, the draft crop doesn't inherit the main crop (and vice-versa), and you can actually draw an additional smaller draft crop on the already cropped preview.  This draft crop is stored in XMP using PM's namespace, not ACR, so as not to confuse the two.

But if you put a 3:2 crop onto a NEF in CNX-2 that already has a crop in the XMP, then PM will think the preview represents the whole RAW image and it will draw its draft crop (which was previously inherited from the main crop).  So relying on the aspect ratio isn't a perfect solution unfortunately.

Now with ACR the situation is similar.  If you draw a crop in ACR that is 3:2 and is close to full resolution (e.g. only cropping a little bit on the edges), then PM will think the embedded preview still represents the full image because the aspect ratio is close to the RAW image (approx 3:2).  So it will draw crop marks on the cropped preview.

I will take a look another look at the DNG tags and see if there is a way to tell if the embedded preview is cropped.  You might think that since ACR updates the preview when you crop then PM should assume the preview doesn't represent the full RAW file.  But if you use PM to draw a crop on a DNG file then PM doesn't update the preview.  So if the only metadata is an XMP ACR crop how is PM to know whether or not the preview has been cropped (other than looking at the aspect ratio or white-listing all the models and their dimensions)?

Do you see the dilemma here?

--dennis

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Crop marks shown on image preview that is already cropped
« Reply #5 on: May 10, 2014, 01:25:09 AM »
Hi Dennis,

Thank you for the, lengthy but very concise, description of the problem. I indeed see the dilemma. But I also see that one way or the other we should really try to fix this (likely other people will have this problem too).

Interestingly I never had this problem with my NX2 cropped NEF files (meaning your original way of determining applied crops seemed to work pretty well), so now, hopefully, we can fix it for DNG files as well.

If there's anything I can do to help research this, please let me know :-)
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Crop marks shown on image preview that is already cropped
« Reply #6 on: October 24, 2014, 11:28:52 AM »
To not let this piece of information get lost (I wrote this as part of an answer in other thread), here's some more info on the issue (and hopefully a way to the solution):

Quote
In my research to find a solution for the crop issue, I did find something interesting that may help to solve the issue of the sensor size. So far every DNG I tested has the EXIF tag DefaultCropSize (and DefaultCropOrigin, but you don't need that), this value corresponds exactly to the image at un-cropped size (at least for my images). This worked even for jpgs I converted to DNG! So I think the solution would be in using this entry, would it not?

Note: I'm always using full sized previews (but that should almost be a given when using PM), so with other sized DNG previews things may be slightly different (but doable).

Hope this helps in building a solution  :)
Hayo Baan - Photography
Web: www.hayobaan.nl