New for CS6?

Photoshop is now running native on 64 bit processors ONLY on Macintosh OS X. Photoshop plug-ins built for 32 bit processors will not load in Photoshop CS6. Please see the SixtyFourMacintosh section "here" for porting a plug-in to 64 bit processors.

Microsoft Visual Studio 2010 with Service Pack 1, 32 and 64 bit builds

Xcode Version 3.2.5, GCC 4.2, SDK 10.6, 64 bit only builds

It is recommended that you use the same build settings for your project.

Photoshop CS6 has new API's for accessing large amounts of data. Although it is not recommended to request large amounts of memory, some algorithms require the entire image. Use the following routines:

PIBufferSuite.h
 - New64
 - GetSize64
 - GetSpace64
PIGeneral.h BufferProcs
 - AllocateBufferProc64
 - BufferSpaceProc64

For BufferProcs usage make sure to check the value of numBufferProcs and also check routines for NULL before accessing them. This will allow runtime checks when running on older versions of Photoshop.

ReadImageDocumentDesc has a new property of SPPlatformFileSpecificationW *fileSpecW. This allows for proper access of files with unicode characters. The SPPlatformFileSpecification_t *fileSpec is now deprecated.

FilterRecord has two new properties to access the current working profile information for the document. iCCWorkingProfileData and iCCWorkingProfileSize. Use this information along with iCCprofileData and iCCprofileSize to color convert if a plug-in is not using the displayPixels routine.

Photoshop CS6 now supports background save of documents. A Format plug-in can save a file out on a separate background thread. This property key reflects the SupportsBackgroundSave property in the PiPL resource file. Formats that rely on Globals, Mac resource manager, or show UI after the formatSelectorWriteStart entry should not allow background save. A format plugin could be called to read a file on main thread while a file is being saved in the background thread. PIFmtSupportsBackgroundSaveProperty

Automation plug-ins that listen to the save event are now going to receive two events when Photoshop is doing a background save. The first event is when the saving starts. The second event is when the saving ends. If a document is in the middle of a background save and the user saves again, the listener plug-in would see two starts and two ends. If a third save is started the second and third save will be consolidated into one and the listener plug-in would see three starts and two ends. Only the user can abort a save in progress. A listener will have to take this into account as you may receive more starts than ends.

Four new properties in PIProperties.h

propScratchVolumeList - Photoshop scratch disk volumes. A list of 4-byte volume index that users have picked as preferred scratch volumes. On windows, this index is 1 based, started from "A:\", so "C:" drive will be 3, "G:" will be 7, etc.

propGPUFlags - This property reflects the current state of the GPU card and the users settings in Preferences. Use this to determine the GPU usage in a plug-in.

propVRAM_MB - This returns the available VRAM in units of 1024*1024.

propLayerIsSmart - Use this property to tell if the current layer is a smart object layer.

New for CS5?

Photoshop is now running native on 64 bit processors on Macintosh OS X. See more information about making 64 bit plug-ins for Macintosh OS X here.

New for CS4?

Photoshop is now running native on 64 bit processors on Windows Vista. See more information about making 64 bit plug-ins for Windows Vista here.

New for CS3?

A large portion of the documentation has moved to an HTML format produced from doxygen. You are reading that right now. This gives a better overall picture of the SDK and easier navigation between topics. The sections to the left are the primary navigation for the SDK documentation.

Adobe Photoshop CS3 is now a Universal binary. Your plug-in needs to be a Universal binary as well to support the MacTel operating system. Apple's Xcode development environment is the recommended way to create a Universal binary. See the Making Xcode Projects for Mac OS section to learn how to move your plug-in to the Xcode environment.

All shipping plug-ins are using the bundle method. You see one file that looks like a plug-in but it is actually a bundle with all the parts inside. See the section below Bundling Plug-Ins.

Two new plug-in types for this version.

  • Stack Renderer plug-ins
  • Measurement plug-ins

3D support

  • Connect your 3D engine for rendering images in Photoshop
  • Manipulate the 3D scene from a filter plug-in
  • Read and Write 3D data using the file format plug-in

File Format plug-ins can now open multi-layered files.

Smart filters for non-destructive editing. See Dissolve example.

  • Add PiPL property, FilterLayerSupport {doesSupportFilterLayers}
  • Do not pop a dialog, use the descriptor params playInfo (gFilterRecord->descriptorParameters->playInfo)
  • - plugInDialogDontDisplay--Display dialog only if necessary due to missing parameters or error.
  • - plugInDialogDisplay--Present the plug-in dialog using descriptor information.
  • - plugInDialogSilent--Never present a dialog; use only descriptor information; if the information is insufficient to run the plug-in, the plug-in should return anerror in theerrorString field of the plug-ins parameter block.
  • Support action parameters
  • - watch out for algorithms that use random numbers

Bundling Plug-Ins

Plug-ins that ship with Adobe Photoshop CS3 and later are now inside bundles. Below is the directory layout for the Dissolve plug-in. The Xcode project settings are given below.

Dissolve.plugin/Contents/MacOS/Dissolve
Dissolve.plugin/Contents/Info.plist
Dissolve.plugin/Contents/PkgInfo
Dissolve.plugin/Contents/Resources/Dissolve.rsrc

The first item is the actual plug-in, the binary executable. The second item is the package info created by Xcode containing the creator and type information to make the package icon for Finder. The third item is the resources for the plug-in in binary form.

The Dissolve example is the only example that shows a Universal binary configuration. The Dissolve example actually shows 6 different build configurations. Debug_PPC, Debug_i386, Release_PPC, Release_i386, Debug_Universal and Release_Universal.

Apple Xcode debugging

  • Insert Debugger() or DebugStr() in places that you want to break
  • Select the "build configuration" you want to debug with - since Universal debug is not properly configured, I choose Debug_PPC (since they are essentially the same - my goal is to debug into the plug-in on PPC)
  • Add a new “Executables” ==> ie. select “Executables” from Groups & Files section, control + click or right click and choose Add... -> New Custom Executable... Name the Executable something meaningful, I call it Photoshop CS3 (ie you can have multiple entries pointing to CS2, CS3, etc). Browse (faster) for CS2 .app folder (to fill for Executable Path) -- after that, click Finish
  • It will show you what it did with a config/info dialog — make sure build products directory is pointing to the right place. (in your case, the Debug PPC path, which it should auto select. If not, go and make that the Active Build Configuration and change the working directory radio button to project then back to Build Products dir, it should select the right stuff)
  • Don’t forget to put a shortcut/symlink of your debug binary into Plug-Ins dir (if it doesn’t exist, build it)
  • You should be set at this point — choose Debug Executable from the Debug menu (or if you activate it on your tool bar, click on the debug button)
  • Use your plug-in — and it should break into your code (it will show you assembly code first — since it’s probably breaking into plug-in API — if so, tell it to step out and you’re in business!

To install

Un-zip the archive. Be sure to keep the folder structure intact. The project settings use relative paths to locate common files for all projects.

On Windows, ignore the __MACOSX folder contents. The zip file is created on a Macintosh for both platforms and there is an extra folder present after the un-zipping.

The documentation included on this kit requires Acrobat Reader to view it. To download a copy of Acrobat Reader free of charge, go to http://www.adobe.com/.

Apple Xcode

All the Macintosh projects in this SDK were tested using Apple Xcode environment, Version 3.1 and 10.5 platform SDK. This is the recommended version for building a plug-in for Photoshop.

Microsoft Visual Studio

All the Windows projects in this SDK were tested using Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) This is the recommended version for building a plug-in for Photoshop.

Memory

Always ask Photoshop for large amounts of memory. See Memory Management for more information.

C++ exceptions

If you turn on C++ exceptions in your plug-in project make sure you wrap all of your call backs with try/catch blocks. You do not want to throw back into Photoshop. This will cause Photoshop to disappear without a warning to the user. Make sure your try/catch blocks are around your PluginMain routine and any OS proc, say for your Dialog routine.

Clean Up

The SDK has gone through some clean up for this version. The C++ wrapper classes for plug-in types have been removed. Along with some of the sample projects. This is around an effort to consolidate the examples. The goal is to have one example for each plug-in type that exposes the key features of the API. There is little value added in wrapping an API in an API and it makes maintenance very difficult. The following projects have been removed: shape and selectorama examples have combined into the selectoramashape example.