Free Support Forum - aspose.com

JPG converted to BMP and PSD, the size will become much bigger


#1

Hi Aspose team,

We are using Aspose.Imaging.dll v18.6 library to convert JPG to BMP and PSD. The original JPG is around 1.0MB, please get the JPG file here:
IMG_20170512_160233.jpg (1.0 MB)

But, after we convert the JPG file to BMP file, the BMP file will become 37MB. If we convert JPG file to PSD file, it also has the problem.

Would you please help check it and see if there’s any solution to Aspose.Imaging.dll?. Thanks in advance


#2

@Glority_Developer,

Can you please try to use Aspose.Imaging latest version 19.2 on your end and if there is still an issue than please share environment details along with generated result and sample code so that we may further investigate to help you out.


#3

We tried 19.2 and also see this problem. Here’s our code. Please have a look. Thanks.

static void Main(string[] args)
{
string sourceFile = “C:\Users\User\Desktop
IMG_20170512_160233.jpg”;
string outputFile = “C:\Users\User\Desktop
IMG_20170512_160233.bmp”;
Image im = Image.Load(sourceFile);
ImageOptionsBase option = new Aspose.Imaging.ImageOptions.BmpOptions();
using (var image = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)im)

{ image.Save(outputFile, option); }

}


#4

@Glority_Developer,

I have observed issue shared by you. An issue with ID IMAGINGNET-3319 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with these issues so that you may be automatically notified once the issues will be resolved.


#5

Is there any progress? Thanks.


#6

@Glority_Developer,

Can you please try using following sample codes on your end and share feedback.

Sample code that produce result like all another image editors (24bpp bmp image):

using (JpegImage image = (JpegImage)Image.Load(@"img.jpg"))
{
BmpOptions options3 = new BmpOptions();
options3.BitsPerPixel = 24;
image.Save(@"img_24bit.bmp", options3);
}

Sample code that produces 8-bit per pixel result image

using (JpegImage image = (JpegImage)Image.Load(@"img.jpg"))
{
BmpOptions options3 = new BmpOptions();
options3.BitsPerPixel = 8;
options3.Palette = ColorPaletteHelper.Create8Bit();
image.Save(@"img_8bit.bmp", options3);
}

To export to PSD you need to use RLE encoded psd files. Here is sample of creation of such file:

using (JpegImage image = (JpegImage)Image.Load(@"img.jpg"))
{
PsdOptions options3 = new PsdOptions();
options3.CompressionMethod = Imaging.FileFormats.Psd.CompressionMethod.RLE;
image.Save(@"img_rle.psd", options3);
}

#7

For BMP, although this can reduce the file size, but it isn’t very good to change 32bpp bmp image to 24 or 8. It will lower the image quality. Especially change to 8.

For PSD, this can reduce the file size.

Do you have any plan if your team will fix it for BMP file, which is logged as IMAGINGNET-3319?


#8

@Glority_Developer,

Thanks for sharing feedback with us. We will share good news with you regarding ETA soon. We are working on this issue. I request for your patience.