Skip to content

Instantly share code, notes, and snippets.

@rsantosdev
Created January 5, 2019 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsantosdev/e586c2dfc7f2518f7e2f9157772b8ffb to your computer and use it in GitHub Desktop.
Save rsantosdev/e586c2dfc7f2518f7e2f9157772b8ffb to your computer and use it in GitHub Desktop.
Reference conversion options for my online course
public class ImageConverter
{
byte[] ConvertToPng(byte[] source, ConversionOptions options) => Execute(source,
$"- -filter Triangle -define filter:support=2 -resize {options.Width}x{options.Height}> -density 150x150 -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip png:-");
byte[] ConvertToJpg(byte[] source, ConversionOptions options) => Execute(source,
$"- -filter Triangle -define filter:support=2 -resize {options.Width}x{options.Height}> -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -quality {options.Quality} -define jpeg:fancy-upsampling=off -interlace none -colorspace sRGB -background white -alpha remove -strip jpg:-");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment