Comments (11)
@JimBobSquarePants Thank you.
I checked again and the results were amazing
from imagesharp.
Hi @sanghv1987
Could you please read over the Contribution Guidelines highlighted to you when you raised this issue. It is imperative that you supply the version numbers as it makes it difficult for us to triage issues otherwise.
Also, please do not combine issues when raising them.
Testing the images I can see that there is indeed a bug in our decoding of interlaced png files. However, I see no issue with the jpeg file. You have simply saved it at a lower quality (hint: Image has a Quality property).
Could you please supply those version numbers.
Thanks
James
from imagesharp.
The png in question is an 8bit interlaced image with no filtering. I'm not sure what is going wrong yet. Looks like an offsetting calculation issue in the Adam7 deinterlacing though.
from imagesharp.
I using last code download from https://codeload.github.com/JimBobSquarePants/ImageSharp/zip/master (01/12/2017).
"version": "1.0.0-alpha1-*"
from imagesharp.
My code test jpg Quality = 100
ImageSharp.Configuration.Default.AddImageFormat(new PngFormat());
ImageSharp.Configuration.Default.AddImageFormat(new JpegFormat());
ImageSharp.Configuration.Default.AddImageFormat(new GifFormat());
string currentDirectory = Directory.GetCurrentDirectory();
string path = Path.Combine(currentDirectory, "Images");
string originFile = Path.Combine(path, "20170101085604.jpg");
Image imageOrigin = ImageFromFile(originFile);
IImageEncoder imageEncoder = new JpegEncoder()
{
Quality = 100,
Subsample = JpegSubsample.Ratio444
};
string newFile = Path.Combine(path, "1280_0_20170101085604_1.jpg");
using (FileStream output = File.OpenWrite(newFile))
{
ResizeOptions options = new ResizeOptions()
{
Size = new Size(600, 0),
Mode = ResizeMode.Min,
};
imageOrigin.Resize(options).Save(output, imageEncoder);
}
reduce the contrast of the image
from imagesharp.
You will "loose contrast" when you do that operation. First of all you are resizing an image and that will change the colors because multiple pixels are combined into a new pixel. And the format that you are using is JPG which is a lossy format and during conversions some of the information will be lost. You are getting the expected output. You could decide to call .GaussianSharpen(0.5f)
on the image before saving i. That will "sharpen" it a bit but my advice would be keeping the image like it is now.
from imagesharp.
Thank Dlemstra. I will keep the current image.
from imagesharp.
Closed by accident, we still need to fix the PNG stuff.
from imagesharp.
@sanghv1987 We've just pushed a fix for the png decoder. We've also done some work to improve jpeg output also. Please download the update from MyGet.
from imagesharp.
@dlemstra Was the genius here. Fixed it in a heartbeat after I spent hours looking at it.
from imagesharp.
It also took me hours 😄 but found it within 10 minutes after a full night's sleep.
from imagesharp.
Related Issues (20)
- Image.Load Error HOT 1
- ImageSharp is not supporting negative values on writing EXIF MetaData HOT 1
- Saving webp to jpg gives strange result HOT 5
- sixlabors.imagesharp is missing NuGet package README file
- Unable to generate a thumbnail as expected HOT 10
- CR2: System.NotSupportedException: Missing SOI marker offset for tiff with old jpeg compression HOT 2
- NullReferenceException when trying to load an animated PNG HOT 1
- Black Background after resizing in the latest version. HOT 4
- AccessViolationException and hard crash with animated webp HOT 8
- Simple conversion of Tiff file to PNG or JPG generates a strange result, even, at certain times, it is in 3D perspective HOT 6
- Please backport CVE-2024-27929 to 2.1.x HOT 20
- no vulnerability free version for netstandard or netframework 4.7 HOT 1
- Cannot update to v2.1.7 due to vulnerability tag HOT 4
- Exception SixLabors.ImageSharp.ImageFormatException: 'reserved bytes should be zero' when using Image.LoadAsync HOT 7
- Exif rotation and save HOT 4
- Error SixLabors.ImageSharp.ImageFormatException: 'Unexpected chunk followed VP8X header' HOT 3
- File (detected as bmp) fails to open, consumes a lot of memory HOT 4
- regression on latest.. 3 vs 2 with GIF HOT 6
- APNG Decoder incorrectly handles frame offsets and dispose previous with blend over HOT 3
- Hard crash (Internal CLR error) with corrupt PNG image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagesharp.