Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Remove ragged black edge from scanned images

$
0
0
The first line only gets the width and height of the image and stores this in a variable to use it at a later moment. So there is not need to do this. What this command does it shave 75 pixels from the image and then resize it back to the original size. You can translate the command to this:
using (MagickImage image = new MagickImage("test.tiff"))
{
  image.Shave(75, 75); // -shave 75x75
  image.BackgroundColor = MagickColors.White; // -background white
  image.Extent(image.BaseWidth, image.BaseHeight, Gravity.Center); // -extent $size
  image.Write("newtest.tiff");
}
The BaseWidth and BaseHeight properties store the Width/Height of the image when it was read. If you do other operations you might not be able to use that value and you will need to store the width and height of the image in a variable right after you read it.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>