ImageSharp icon indicating copy to clipboard operation
ImageSharp copied to clipboard

JpegEncoderOptions quality documentation misleading (kinda)

Open MeLikeChoco opened this issue 9 years ago • 3 comments

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have verified that I am running the latest version of ImageSharp
  • [ ] I have verified if the problem exists in both DEBUG and RELEASE mode
  • [x] I have searched open and closed issues to ensure it has not already been reported

Description

The description for quality in the JpegEncoderOptions states, "Gets or sets the quality, that will be used to encode the image. Quality index must be between 0 and 100 (compression from max to min)." However, setting quality to 0 actually doesn't work. Setting it to 1 does. I was trying to recreate the "needs more jpeg" meme and stumbled upon this problem.

Steps to Reproduce

Maybe it's just me and my computer. Setting quality to 0 does nothing to the naked eye, nothing has really changed. Of course, I haven't done much research as to how much change setting quality to 0 does.

  • ImageSharp version: most recent on nuget
  • Environment (Operating system, version and so on): Windows 7

Edit: I'm quite a newbie coder, so I didn't catch on till 7 hours of trying to solve this problem ;_;

MeLikeChoco avatar Jun 28 '17 02:06 MeLikeChoco

Also, kind of a counter-productive question to what you guys are trying to achieve here, but what other methods are there to create more artifacts in an image? :stuck_out_tongue:

MeLikeChoco avatar Jun 28 '17 03:06 MeLikeChoco

Hi @MeLikeChoco - Just tested using Paint.NET and zero is a valid parameter value there so we should do the same.

Should be simple enough to fix. Thanks!

JimBobSquarePants avatar Jun 28 '17 04:06 JimBobSquarePants

@MeLikeChoco Finally got around to fixing this.

Re your question.. You could always add random noise to individual pixels.

JimBobSquarePants avatar Oct 06 '17 04:10 JimBobSquarePants