Hi Photoshop developers,
I'm a developer with a few Photoshop filter and selection plug-ins under my belt, and I have a good understanding of the SDK and tools and suites it provides. My next project is an algorithm for enlarging/resampling images to different pixel dimensions. I'm wondering if anyone has any suggestions for or experience with the best combination of plug-in types to implement this.
Clearly, I can't just write it as a filter plug-in, since there is no way to change the image dimensions from within a filter.
I'd like the resized image to remain within Photoshop (as a new window or in the original one), so an export plug-in on its own is not sufficient.
Import plug-ins seem promising, since they allow the creation of a new document of the required size. However, as best I can tell from the Photoshop 6.0 SDK documentation, import plug-ins cannot access the image data from other open documents (or even the clipboard), nor do they provide any support for channel ports and the Channel Port suite.
My best idea at this stage is to create an export plug-in to provide the user interface and calculate the resized image, and then an import plug-in to import the resized image back into a new window. (I'm supposing a further automation plug-in would then be written to perform this export/import sequence.) The difficulty I see with this approach is how to communicate the resized image data between the two plug-ins. Since the resized image will potentially be very large, the ideal solution would be to store it in channels managed by the Channel Ports suite. However, I cannot see how the channel ports created in the export plug-in could be communicated to and used by an import plug-in. The alternative would be for the export plug-in to save the resized image to a temporary file on disk, however this seems unnecessary.
So, my questions, specifically, are:
a) Is it possible to create new channels using the Channel Ports suite (sPSChannelPorts->New()) in one plug-in, and have those channels persist to be used in another plug-in?
b) If so, how would the channel ports be communicated between the plug-ins?
c) Alternately, are there any alternative architectures available for implementing an image-resizing algorithm using the plug-in types that are available for Photoshop developers.
Any responses would be greatly appreciated; I know this is a low-traffic forum...
Thanks,
Matthew.