قالب وردپرس درنا توس
Home / Mac / Ins and outs of Non-destructive editing in images for Mac and iOS

Ins and outs of Non-destructive editing in images for Mac and iOS

One of the closely magical properties of Photos, and iPhoto before it, is the way it allows you to edit an image with the intention that these changes are non-destructive – you can always go back to the original version. That said, non-destructive editing causes some confusion, especially for those working on RAW images or using Photo Extensions to edit.

To illustrate the situation, I first explain how non-destructive editing works in image applications in general, using images as an example. Then, I will go into details on how non-destructive editing in Photos works with RAW image files, Photos extensions, and more. I will also identify some issues.

To give you some background, I was the leading developer of Aperture, and later I led the team that developed the editing engine for the Mac version of Photos. Now I am on my own, developing a photo extension called RAW Power that uses the same RAW engine that underlies images and aperture. In this article, I often use RAW Power as an example, although other image extensions work the same way. If you're not familiar with RAW, you may want to read a separate article by me that discusses the benefits of RAW as well as touching Apple's new HEIF image format.

Non-Destructive Editing Basics

Most applications directly change your documents. For example, when you select Save to Microsoft Word, you save the changes directly to the document's file, replacing the previous version of the file in the process. Some image editing programs also directly change image files, especially Adobe Photoshop and Apple's preview.

In contrast, most imaging programs work non-destructively and never change the original image. The application applies to changes in a memory copy of the original to provide a preview of the adjusted image.

 A basic example of non-destructive editing.
The program can automatically save the editing instructions, or it can wait for you to press Done or select Save. From your point of view, the picture appears to be changed, but the original file remains untouched. Although extremely useful, this non-destructive model can confuse users because it meets their expectations based on other applications.

Images store the editing instructions in a location separated from the original file, and generate JPEG (and full size) smaller thumbnails) containing the results of the changes. (Pictures make JPEG for all file types, including RAWer and Apple's new HEIC files. You can't rely on the Info panel in the Mac version of images to tell you the type of file you're editing because it always shows the file type of the original.) After editing is completed, this is what is stored on disk:

 What is stored in non-destructive editing.

Full-size JPEG is an individual file on disk. The smaller thumbnails are stored in "container" files that hold multiple thumbnails at once. The editing instructions are stored in the photo library's database along with other information about the image.

If you want to continue editing the image at a later time, images will reload both the original and the editing instructions and combine them to display them. It adjusted the image.

Out of edit mode, Photos hides the original image from view, instead displays JPEG or smaller thumbnails of all sizes at each point in the application. Although this is clearly correct, the original notion reinforces that the origin has changed. This is the most important confusion point for people. Many users ask me how to copy or copy images before editing them – they are convinced by images that are weak in the hand and think they need to preserve their original before making adjustments. (Some copy images because they want both unadjusted and aligned copies visible in the grid, but this is less common.)

Ironically, there is a cause for non-destructive editing because RAWer cannot be edited in place. It is not possible to make arbitrary editing to RAW sensor data, and from these changes, create RAW sensor data (it is possible to create a linearized DNG but linearized DNGs are not RAW images). Images never change the original RAW images.

Why review all these issues? Because non-destructive editors offer three key features:

  1. Instantly display the original image to allow A / B comparisons
  2. Discard all edits and thumbnails for an image, reveal the original
  3. Change or remove individual edits without loss of quality

Pictures always save the editing instructions in the library's database. Other programs can use a database or store them in separate "sidecar files", usually with the same name with another file type. For example, for an image called IMG_0005.JPG, a program can store a sidecar named IMG_0005.xmp or IMG_0005.dat in the same directory. Sandboxed apps can store the sidecar elsewhere.

Sidecars are general purpose, so they can also contain thumbnails and various metadata, such as rankings. Programs additionally store the sidebar information in the original file, because most image formats can store various data without changing pixels or impairing the ability of other programs to read the original image data. This ensures that the editing information remains with the original file data, but can lead to corruption or data loss if the program does not properly insert the data into the original file. In addition, not all applications maintain proper side-car data from other applications when they write the page data in the original file. For these reasons, many photographers prefer that the side cars be stored separately from originals.

Images Extensions

Although we mostly think of non-destructive editing in conjunction with the original editing tools in Pictures, it's not the only place it's used. Developers can create a type of plug-in, called a "Photos extension" that provides additional editing features for Photos. To access images, you can start editing an image, and then click the Extensions (···) button at the top of the window.

 Accessing image extensions

Images extensions do not add more sliders to the Image Editing interface. Instead, they replace the default images tools completely.

 Picture extension replacing the standard controls
Photo extensions completely replace the image editing tools while they are active.

As with normal editing in images, images extensions allow you to edit only one image at a time – you cannot use an expansion of images to correct white balance in a series of ten images. When selecting an image extension, the images open the extension and send it to the original file:

 How images send images to extensions

When you click the Save Changes button in the image extensions interface, the photo extension gives images back their editing instructions and a full JPEG, as shown here:

 The extension that transfers JPEG and instructions back to Photos

As a result, image extensions participate in the same non-destructive system that Photos uses for its own image editor. Images store JPEG and extension editing instructions in the library. Then, make full-size JPEG thumbnails and hide the original.

If you decide to re-edit the image with the same image extension, images will transfer the extension to the original image along with the extension editing instructions. Again, this is just like Pictures do for their own editing system:

 Editing an edited image with the same extension it was edited with

The image extension can display the original, and remove or adjust any previous edits that is done in the Photos extension. Even better, the image extension adjustment data is synchronized via the iCloud Photos, allowing you to continue editing with that Photos extension on another device. That means you can edit with the RAW Power extension on a Mac and continue editing non-destructively on another Mac with the RAW Power extension, or in iOS with the RAW Power app.

This is also how the system works in iOS, with an important limitation. Photo extensions in iOS 12 are never passed a RAW image. They always get a rendered JPEG. So don't worry about editing a RAW image with an extension of photos in iOS 12. I filed a bug some time ago; hopefully, Apple will fix it in iOS 13.

An aircraft in the ointment

This approach works as long as only one program or image extension edits an image. As soon as two editors enter the mix, things go side by side. This is because images can store the adjustment information for only one editor for a given image. Once the changes from another editor have been saved, the editing instructions from the first edit are discarded and cannot be restored! The image data is preserved, but the ability to make changes with the first editor is lost. This is another important point of confusion for customers.

To illustrate this problem, imagine that a user decides to use the Photo Enhancement feature on a RAW image and then use the RAW Power extension to use a crop and vignette. Images have a good auto enhancement, and unlike the Vignette tool, RAW Power Vignette lets you choose the center of the vignette.

Step 1: The user clicks the Auto Enhance button and clicks Done. As described earlier, Photos stores a full-size JPEG and the adjustment parameters in the library (the original is present but hidden):

 How images change an image

Step 2: The user selects RAW Power from the Photos extensions menu. Here we go into the first difference from the previous example: Photos send the JPEG format (not the original RAW image) to the Photos extension. Images send a JPEG instead of the original because the user expects to see the automatically enhanced image in the Photos extension, not the unadjusted original. Since Apple does not publish the internal format for adjustments, it also does not allow access to the code for adjustments, there is no way for an image extension to use automatic enhancement done in Photos. This also applies in the reverse – if a user edits an image with an image extension, and then edits further in Photos, they work in Photos with a rendered JPEG Photos, have no way to use changes of other companies' extensions to the original file.

Step 3: The user uses Crop and Vignette in RAW Power and clicks Save Changes. This is what is stored in the Photos library:

 Losing editing data in Photos

Note that Photos have just thrown their own adjustment data! Although everything may look good, the image editing information has been lost and the user is never informed. While the user can return to the Photos extension and adjust the crop or vignette (or any other adjustment in the extension), they cannot step back one step and fine-tune the sliders in Photos. Furthermore, the user cannot pre-press the step before invoking the photo extension. The only available option is Reset to original because there is no Apple alignment data left to return to.

Note that there are now also two JPEGs stored in the library, one from Photos and one from the Photos extension. This is necessary to maintain anything of non-destructive editing. The first JPEG is the one created by Pictures as a result of the Auto Enhance step and handed over to the Photos extension. Remember that in order for the user to edit an image with the same editor, the editor must receive "startup image" along with the editing instructions. In this case, the "Startup" JPEG is created after Auto Enhance was used. Although there are two JPEGs, only the final JPEG is visible in the user interface. The automatically enhanced JPEG is hidden; It is only stored in the library to enable redesign with the Photos extension.

"But" you can say "I can edit in Photos, then use a Photos extension, and return to Photos and continue editing." True, but you adjust the JPEG file sent back from Photos- extension, not the original adjustments you made in Pictures to the RAW file. Imagine making the edited image black and white. This is what has been saved:

 Losing editing data with an image extension

In other words, stacking image adjustments on top of the RAW Power adjustments (and losing the RAW Power adjustment data in the process).

Also note that this loss of adjustment data will occur if you edit in the Photos extension first and then edit in Photos, or if you are not editing in Photos at all, but instead do all editing with two images extensions . Order doesn't matter – just use two or more editors on the same image.

A RAW-specific note: If you first edit a RAW in Photos, then send the image to RAW Power or another RAW-friendly Photo extension such as DxO OpticsPro, not just work in the Photos extension with an 8-bit JPEG , instead of a 12 or 14 bit RAW, you lose access to the RAW processing features that RAW Power or DxO provides. This serious loss of quality happens to any editing done in Photos, even a simple rotation or flip.

This gotcha also carries its ugly head if you want to use two RAW capacity photographs. In this situation, what image extension should you use first? RAW Power has strong RAW editing controls, based on the same engine that Photos uses. DxO has high quality lens correction. I think it's best to start with RAW Power to access the RAW-only editing sliders and use DxO OpticsPro because DxO's lens correction works on both RAW and JPEG.

I want pictures to warn users when quality is corrupted or adjustment data is lost. Photo extensions cannot warn users of this issue because of the way the Photo Extensions communicate with Photos — they don't even know it's an RAW original. This is a warning only pictures can provide. If this happens to you (and you notice it in time), you should:

  1. Cancel the editing in the Images extension
  2. Return to original in images
  3. Enter the extension

I exported a TIFF from a what?

When saving edited RAWs for posterity, photographers prefer 16-bit TIFFs because they can store all the richness of an edited RAW in a universal image format. For best results, the export should start with an image format whose quality is equal to or better than the destination file format. RAW is superior to TIFF, and TIFF is superior to JPEG. Consequently, if you edit a RAW in images and later export a TIFF, you get good results because images will load RAW, use the RAW editing instructions, and then generate TIFF.

That's not true for image extensions. As mentioned earlier, extensions are required to send JPEG files back to Photos, instead of TIFFs. If you use Photos to export an image edited by an extension, Photos uses JPEG as the source. I repeat it: Your 16-bit TIFF will be created from an 8-bit rendered JPEG, not using the adjustments to the original, as Pictures do for images edited by custom tools. Images use a source of lower quality than the destination. The exported image is basically a JPEG decompressed to a TIFF.

There is a good, if unsatisfactory, reason for this: Images cannot return to the extension and ask for a rendered, full size TIFF because the extension may have been uninstalled or the image may have been synchronized with a device such as missing the extension. This is another case where images should warn users. It is unreasonable to assume that users understand that their 16-bit TIFF is made of an 8-bit JPEG.

A word to the wise: There is no point exporting a TIFF from Photos if you have edited the image with an extension. I had to add a button in the RAW Power extension to export TIFFs, which is a bit crazy but necessary.

Support for multiple editors and TIFF exports would be enhanced if extensions could return TIFFs to Photos and whose images could send TIFFs to extensions. This can be a login feature for extensions and users who want the best quality.

Do not edit with "Edit with"

Images have yet another way of working with third-party editors, and unfortunately it is

 The Edit With menu.

This feature is intended to allow users to edit applications that modify files directly, such as Photoshop and preview, which do not have image extensions. However, any application that can edit images will appear, including some that do not make much sense in this context. Confusing, the list can also include apps that provide image extensions, if they can also edit images outside images (as RAW Power does). Highlighted by the command means it's too easy for customers to choose Edit with RAW Power instead of the RAW Power extension. Extensions that you want to see integrate much better with images. (As a simple solution, images can filter out applications with Photos extensions from the Edit with list.)

Because Apple intended to edit with for use with destructive editors, photos protect the original. Instead of sending the original file, Photos copies a copy in the library and sends the copy to the remote editor. The editor changes the copy and non-destructive behavior is maintained. In a way. Because the external editor makes damaging edits, all the Photos can do, keeping the ability to use Return to Original. No editing information is stored in the Photos library (since there are none), and the user cannot change the changes afterwards in Photos or the external editor. (It is technically possible to have a more non-destructive workflow, but it requires you to save the changes separately and manage them yourself. It takes great care and is very misleading.)

I mentioned that Pictures begin to make a copy of the original. It's not exactly accurate. If the original is a RAW, Images instead sends a TIFF. Why? Because it must provide a file that the destructive editor can change, and as I mentioned earlier, RAWer cannot be edited and rewritten. In addition, not all editors support RAWer.

Therefore, Edit With is a particularly poor choice for RAW editing. I fill many questions from customers and wonder why they can't edit RAW with RAW Power. The reason is usually that they used Edit with instead of the RAW Power extension. It may be possible for external apps to hunt around in the Photos library and find RAW, but it is sketchy and not recommended (sandboxed apps can't do that anyway).

Conclusion: Non-destructive editing is great, most of the time

Non-destructive editing gives users valuable features such as instant reset, A / B comparisons and fine-grained control over the editing process. However, it establishes a substantially different interface paradigm that applications do not communicate well with the users. The non-destructive illusion leads many photographers to believe that the originals are modified when they are only hidden. These photographers then protect their originals by duplicating images unnecessarily. While smart copying can minimize disk cost, such duplication leads to complexity and visual noise due to extra images in the grid. Some education will reduce the customers' nervousness when editing prized images.

In addition to their own editing tools, images provide an interface with pure extensions that provide non-destructive editing and synchronization through iCloud. It has some warts, including issues with multiple editing support, export and Edit with feature. But with a few fixes, Apple can greatly improve the non-destructive workflow in Photos, both in quality and comprehensibility. For that purpose, I have submitted errors with Apple with my suggestions. Hopefully we will get some improvements in a future release of images for MacOS and iOS.

Nik Bhatt, formerly Senior Director of Engineering at Apple, led the Aperture and iPhoto engineering teams for several years. Afterwards, he led the image processing team for Apple's image applications, including the teams responsible for Core Image and Apple's RAW Camera Library. He is now a developer of RAW Power, an advanced photo editing app for Mac and iOS.

Source link