Giter Site home page Giter Site logo

Comments (11)

sanghv1987 avatar sanghv1987 commented on May 13, 2024 1

@JimBobSquarePants Thank you.
I checked again and the results were amazing

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on May 13, 2024

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.

JimBobSquarePants avatar JimBobSquarePants commented on May 13, 2024

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.

sanghv1987 avatar sanghv1987 commented on May 13, 2024

I using last code download from https://codeload.github.com/JimBobSquarePants/ImageSharp/zip/master (01/12/2017).
"version": "1.0.0-alpha1-*"

from imagesharp.

sanghv1987 avatar sanghv1987 commented on May 13, 2024

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

1280_0_20170101085604_1

from imagesharp.

dlemstra avatar dlemstra commented on May 13, 2024

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.

sanghv1987 avatar sanghv1987 commented on May 13, 2024

Thank Dlemstra. I will keep the current image.

from imagesharp.

dlemstra avatar dlemstra commented on May 13, 2024

Closed by accident, we still need to fix the PNG stuff.

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on May 13, 2024

@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.

JimBobSquarePants avatar JimBobSquarePants commented on May 13, 2024

@dlemstra Was the genius here. Fixed it in a heartbeat after I spent hours looking at it.

from imagesharp.

dlemstra avatar dlemstra commented on May 13, 2024

It also took me hours 😄 but found it within 10 minutes after a full night's sleep.

from imagesharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.