Imaging resize

Hello, we have some problems resizing images, like psd (as you can see in attached sample files one image with original dimensions and uno image after applying resize method)

This is the code we use to resize images (we use a limit of 1024 pixel)

int iWidth = 1024;
int iHeight = (int)((1024.0f / (float)((Aspose.Imaging.Image)m_oDocument).Width) * (float)((Aspose.Imaging.Image)m_oDocument).Height);
((Aspose.Imaging.Image)m_oDocument).Resize(iWidth, iHeight, Aspose.Imaging.ResizeType.NearestNeighbourResample);


but the resulting images appear to be with bad “pixelate” effects. we tried other resize types other than NearestNeighbourResample but final result is somehow bad (a simple resize of the images in image programs do a better work)

what we can do to go forth with better quality?
thak’s a lot

Hi Valerio,


Thank you for contacting Aspose support.

I have checked your provided images, and I am able to observe the decrease in quality for the exportIMGaspose.png file. I believe the said image was generated while using the ResizeType.NearestNeighbourResample. Please note, if you intend to get quality result after applying the re-size then it is suggested that you should always use ResizeType.LanczosResample because it will output qualitative results but may work slower than ResizeType.NearestNeighbourResample. On the other hand, ResizeType.NearestNeighbourResample algorithm is specifically designed for fast re-sizing while compromising on the image quality. This method may be useful for thumbnail generation in real time or similar processes where performance is required.

Anyway, I will perform further tests to assist you further in this regard. Right now, I am a bit confused as you have mentioned PSD in your post. Could you please confirm, are you performing the conversion process (PSD>PNG) before the re-size operation? If yes, I will also require the sample PSD for my testing.

Hi Babar,
yes the problem is in the resize method: we tried NearestNeighbourResample and LanczosResample (and all the other that don’t crop original image) but quality results are the same.
We use resize method before saving every kind of images to PNG: we’re focusing on sample PSD’s only because loss of quality is more evident when resizing.
I attach one sample psd.
Thank you

Hi Valerio,


Thank you for providing the sample PSD for testing. I have executed the complete scenario by performing the resize & conversion process, and was able to observe the decrease in quality/sharpness in the resultant image. I have logged it as an investigative ticket (IMAGING-34732) for the product team’s review. Please allow us some time to properly analyze the scenario, and get back to you with updates in this regard.

Hi Valerio,


This is to inform you that we have scheduled the ticket IMAGING-34732 for the 2nd quarter of 2015. Please note, the currently available algorithms such as LanczosResample & NearestNeighbor for the re-size operation will decrease the image quality a bit because the pixels are stretched. However, other algorithms such as LeftTopToLeftTop will not stretch the pixels but may produce blank areas (padding) at right & bottom of the resultant image because the operation simply takes the source’s left top point and maps it to the destination’s top left. In order to address you concerns, we are analyzing other algorithms that may not stretch the pixels while re-sizing operations.

As soon as we assign a fix version to the aforesaid ticket, we will provide the estimated release schedule here for your kind reference.

The issues you have found earlier (filed as IMAGING-34732) 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 ) have been fixed in this Aspose.Words for JasperReports 18.3 update.