question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image size is lighter from command-line tool than that of Magick.NET code

See original GitHub issue
  • Magick.NET version: -Windows 10, Magick.NET-Q16-AnyCPU: 7.14.0.0

Question

My .Net code as below gives image with size 644KB and from command-line i get 395KB. Is there something i need to change/add in the code?

All the input values are same in both the cases.

.NET code:

using (MagickImage image = new MagickImage(inPath))
{
    using (var newImage = image.Clone())
    {
        newImage.Resize(size.Width, size.Height);
        newImage.Strip();
        newImage.Format = MagickFormat.WebP;
        newImage.Quality.Equals(quality);
        newImage.Settings.SetDefine(MagickFormat.WebP, "lossless", "false");
        newImage.Write(outPath + ".webp");
    }
}

Command-line code: convert $inputFile -strip -resize $dimension -quality 90 -define webp:lossless=false $outFileName

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
amar132commented, Jun 22, 2019

And thanks for the quick responses.

0reactions
amar132commented, Jun 22, 2019

Well, it worked. That was stupid of me. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Magick.Net Image FileSize is always Zero
You are getting 0 for the file size because the frames of the image are not aware of the size of the complete...
Read more >
Annotated List of Command-line Options
Below is list of command-line options recognized by the ImageMagick command-line tools. If you want a description of a particular option, ...
Read more >
GraphicsMagick Image Processing System
GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image...
Read more >
ImageMagick: Command-line Options
Below is list of command-line options recognized by the ImageMagick command-line tools. If you want a description of a particular option, ...
Read more >
How to resizing bulk images at once by using a good tool ...
I want to decrease all of the files' sizes such that they are all ... How to resizing bulk images at once by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found