Hi, I’m evaluating the Imaging library but I didn’t find any information or example about exporting .psd layers.
What we need to do is to export all the different layers (text and images) with some content, if possible I’d like also to crop them so the resulting image will be as small as the actual layer content.
I checked the api reference but I had no luck.
Thanks
Damiano
Hi Damiano,
Thank you for considering Aspose products, and welcome to the Aspose.Imaging support forum.
Unfortunately, the current implementation of Aspose.Imaging APIs does not provide means to export specific layer(s) of a PSD file to raster image formats. We intend to log an appropriate ticket in our database to bring this feature on the road map of Aspose.Imaging APIs but we first need to make sure that we have understood your requirement correctly. Could you be kind enough to confirm that our understanding is correct? In case we have missed some details, please elaborate your requirement further. Thanks in advance.
Hi, thank You for the quick reply.
The main feature we need is the ability to export layer by layer to a raster image (file or stream);
from the text layers we just need to extract text, text location and font information.
It would be nice also to be able to crop a layer so the resulting image would be as small as possible.
Something like this:
layer.CropToRaster(…) -> returns raster image of the layer content cropped to the minimum size
layer.GetContentLocation() --> return coords of the content (top left corner) after cropping
Hi Damiano,
Thank you for the elaboration on your requested features. We are able to identify two features and have logged them in our database for further analysis. The details are as follow,
- IMAGING-33211: This ticket was already logged in our database to support the PSD Textual Layers. Once we provide the fix for this ticket, you will be able to retrieve the contents from a text layer along with additional information such as font, style etc. We can further enhance the feature upon your request however, we have to first provide the core functionality, that is to retrieve the textual layers.
- IMAGING-34291: This ticket has been logged in reference to your requirement of exporting PSD layers to raster images (or instances of RasterImage class). Once we are able to retrieve an instance of RasterImage class from a PSD layer, you will be able perform all the operations supported by RasterImage class, including Resize, Crop, Rotate etc.
Unfortunately, we are not clear about your last request as quoted below,
layer.GetContentLocation() --> return coords of the content (top left corner) after cropping
Do you wish to retrieve the coordinates of the cropping rectangle or the coordinates of the shapes inside the image? Please elaborate this requirement in more details.
Hi,
i was talking about the coordinates of the cropping rectangle
Damiano
Hi Damiano,
Thank you for the confirmation.
RasterImage class provides the Crop method, that accepts a Rectangle as parameter in order to perform the cropping on a provided image. I hope this method will fulfill your requirements as soon as the API provides the means to convert PSD layer(s) to instance of RasterImage class.
C#
var image = (RasterImage)Image.Load(myDir + “sample.bmp”);
image.Crop(new Rectangle(0, 0, 100, 100));
image.Save(myDir + “output.bmp”);
The issues you have found earlier (filed as IMAGING-34291) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The issues you have found earlier (filed as IMAGING-33211) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(2)
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.