Giter VIP home page Giter VIP logo

Comments (14)

jaredfolkins avatar jaredfolkins commented on August 16, 2024

Yup. I'm seeing something similar here. Extremely subtle at first glance but take a look for yourself. I had a hunch and rolled resize back to the previous commit (like I did here).

resize git:(581d15c)
profile_large-1

resize git:(bdfbbea)
profile_large

from resize.

nfnt avatar nfnt commented on August 16, 2024

Could you tell me which size the input images have and to which size you're resizing them to? While doing the optimizations, I had some numerical instabilities that where only visible at certain scale ratios. I thought that I sorted that out. Doesn't seem to be the case.

from resize.

jaredfolkins avatar jaredfolkins commented on August 16, 2024

The original image is 600x450.

adam-levine-blonde-600x450

I rotated the image to 450x600.

adam-levine-blonde-450x600

I then processed it and the artifacts still exist.

profile_large

from resize.

jaredfolkins avatar jaredfolkins commented on August 16, 2024

Interestingly cropping gifs doesn't appear to have the issue?

apple

profile_large

Gifs are being processed as RGBA where I'm thinking pngs and jpgs are coming across as YCbCr.

I noticed this function call is the primary difference in the process. Just an observation for now. Who knows if it has value.

https://github.com/nfnt/resize/blob/master/resize.go#L137

from resize.

jaredfolkins avatar jaredfolkins commented on August 16, 2024

A different gif sample to show it isn't being effected.

amalgamation_micael_reynaud

profile_large-1

from resize.

aarondl avatar aarondl commented on August 16, 2024

This is the input image 28.jpg JPEG 320x180 320x180+0+0 8-bit DirectClass 11.3KB 0.000u 0:00.000

28

I'm resizing it so that the aspect ratio is kept, to a height of 630. Again, tried multiple filters, each seem to suffer from this in some form or another.

from resize.

mrcwinn avatar mrcwinn commented on August 16, 2024

Hey there, I'm seeing this too.

My sample image from unsplash.com (http://33.media.tumblr.com/537d8986d6b8df79a9fd6901e7174fe2/tumblr_nbk5oaEN2n1st5lhmo1_1280.jpg) is 1280x848. Downsampled to 320x212 and the image suffers heavily from artifacting.

from resize.

nfnt avatar nfnt commented on August 16, 2024

Fixed in 0c6a628. The indexes used for reading the input images values were faulty and led to these artifacts. Regression from ccddecd.

from resize.

aarondl avatar aarondl commented on August 16, 2024

Thanks so much for fixing this. This package is great by the way.

from resize.

nfnt avatar nfnt commented on August 16, 2024

Thank you!

from resize.

mrcwinn avatar mrcwinn commented on August 16, 2024

Hey @nfnt - I'm noticing the artifacts have returned using Go 1.3.1 and current resize. Here are the images:

resized

original

The resize quality if really poor. I'm trying to gather more information. Oddly, I haven't noticed the issues when building from my other machine (same versions!). In both cases, I'm building with a target platform VM — so the environment is literally the same. It's strange!

from resize.

mrcwinn avatar mrcwinn commented on August 16, 2024

I can confirm the issue is on both my computers - I just didn't notice it on the laptop because it's retina and the @2x was getting shrunk in the browser.

from resize.

nfnt avatar nfnt commented on August 16, 2024

The artifacts you see are JPEG compression artifact and are not caused by this package. Try encoding the JPEG with a higher quality or encoding to a lossless image format like PNG.

from resize.

mrcwinn avatar mrcwinn commented on August 16, 2024

You're right. Sorry for the false alarm @nfnt — I just realized the standard jpeg library uses a 75% compression const when encoding, which I need to override.

Great work on the package!

from resize.

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.