Reducing a JPGs resolution without losing quality
Posted: 2016-08-09T05:03:58-07:00
Hi,
I'm giving ImageMagick a go as no matter what I do, the standard C# image functions are useless and will lose image quality.
ImageMagick is giving a slightly better output, but I'm still having trouble.
Original Image: removed, problem solved
Resized: removed, problem solved
Perfect Photoshop resize, use to compare: removed, problem solved
The code:
The link to the resized image above was generated use the exact code above. I have also been trying the various filter types and unsharp masks, but had no luck.
I have also tried the mImage.Thumbnail() method, but no luck there.
I linked a Photoshop resized version of the image, which is spot on, no visible quality loss or change.
As you can see, it seems to lose some colour or sharpness, but I just can't figure out how to fix it.
Any ideas?
Thanks.
I'm giving ImageMagick a go as no matter what I do, the standard C# image functions are useless and will lose image quality.
ImageMagick is giving a slightly better output, but I'm still having trouble.
Original Image: removed, problem solved
Resized: removed, problem solved
Perfect Photoshop resize, use to compare: removed, problem solved
The code:
Code: Select all
using (MagickImage mImage = new MagickImage(@"c:\users\craig\desktop\orig.jpg))
{
mImage.Quality = 82;
mImage.Density = new Density(72);
//mImage.UnsharpMask(2, 0.5, 0.7, 0);
mImage.ColorSpace = ColorSpace.RGB;
//mImage.FilterType = FilterType.Mitchell;
mImage.Resize(400, 0);
mImage.Write(output);
}
I have also tried the mImage.Thumbnail() method, but no luck there.
I linked a Photoshop resized version of the image, which is spot on, no visible quality loss or change.
As you can see, it seems to lose some colour or sharpness, but I just can't figure out how to fix it.
Any ideas?
Thanks.