1
How to compress an image?
Question asked by Abdu Bukres - 5/5/2018 at 3:59 PM
Answered
How to compress an image so that the file size is smaller? I don't see a method for this or to save with compression enabled.

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Answer
If you are talking about uncompressed image formats like BMP you can save the image as JPG to reduce the size:
using (var imageTask = new ImageTask(@"C:\Pictures\Picture1.bmp"))
    imageTask.Save(@"C:\Output\Picture2.jpg");

//Or in ASP.NET:
this.ImageTag("Image.bmp", task => task.Format(ImageWebSafeFormat.Jpg))
JPG default compression setttings are already optimized. However we can expose the settings in our API to allow changing the compression manually in future versions.
 

Reply to Thread