{"action":"created","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/310","labels_url":"https://api.github.com/repos/lovell/sharp/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/310/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/310/events","html_url":"https://github.com/lovell/sharp/issues/310","id":117839820,"number":310,"title":"help with image downsize quality improvement","user":{"login":"jcupitt","id":580843,"avatar_url":"https://avatars.githubusercontent.com/u/580843?v=3","gravatar_id":"","url":"https://api.github.com/users/jcupitt","html_url":"https://github.com/jcupitt","followers_url":"https://api.github.com/users/jcupitt/followers","following_url":"https://api.github.com/users/jcupitt/following{/other_user}","gists_url":"https://api.github.com/users/jcupitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jcupitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcupitt/subscriptions","organizations_url":"https://api.github.com/users/jcupitt/orgs","repos_url":"https://api.github.com/users/jcupitt/repos","events_url":"https://api.github.com/users/jcupitt/events{/privacy}","received_events_url":"https://api.github.com/users/jcupitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-19T15:39:05Z","updated_at":"2015-11-19T16:18:40Z","closed_at":null,"body":"Hi all, I've been looking at `vips_resize()`, the vips function that sharp uses for downsizing, and I think I've maybe found a couple of things which can improve quality, especially for small downsizes.  Would anyone be able to help test the changes?\r\n\r\nCode changes in this commit:\r\n\r\nhttps://github.com/jcupitt/libvips/commit/8506ff13a674372d28b62b4a5e5f3e22e516fc01\r\n\r\nThere's a test image here, plus sample shrinks from `vipsthumbnail` and `convert`. Put the images in separate tabs and try flipping between them.\r\n\r\nhttp://www.rollthepotato.net/~john/skin/\r\n\r\nThe test image is an interesting one since it combines fine, high-contrast detail in the hair, plus a strong skin texture (I hope the subject doesn't mind me saying that). The downsize needs to minimise aliasing in the hair while retaining texture in the skin.\r\n\r\nThe old `vips_resize()` avoided anti-aliasing nicely, but had the effect of almost airbrushing the skin. The three changes in the patch:\r\n\r\n* reduce the strength of the anti-alias filter slightly\r\n* does not do the final sharpening pass if we skipped the anti-alias filter\r\n* fixes a bug where the sharpening would be skipped if there was no box filter\r\n\r\nAny thoughts? Would someone be able to compare to photoshop? I remember we had an interesting discussion the last time we went over this code. "},"comment":{"url":"https://api.github.com/repos/lovell/sharp/issues/comments/158105759","html_url":"https://github.com/lovell/sharp/issues/310#issuecomment-158105759","issue_url":"https://api.github.com/repos/lovell/sharp/issues/310","id":158105759,"user":{"login":"lovell","id":210965,"avatar_url":"https://avatars.githubusercontent.com/u/210965?v=3","gravatar_id":"","url":"https://api.github.com/users/lovell","html_url":"https://github.com/lovell","followers_url":"https://api.github.com/users/lovell/followers","following_url":"https://api.github.com/users/lovell/following{/other_user}","gists_url":"https://api.github.com/users/lovell/gists{/gist_id}","starred_url":"https://api.github.com/users/lovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovell/subscriptions","organizations_url":"https://api.github.com/users/lovell/orgs","repos_url":"https://api.github.com/users/lovell/repos","events_url":"https://api.github.com/users/lovell/events{/privacy}","received_events_url":"https://api.github.com/users/lovell/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T16:18:40Z","updated_at":"2015-11-19T16:18:40Z","body":"Hi John, sharp doesn't currently use `vips_resize` :scream: although I'd very much like it to (e.g. #299).\r\n\r\nOne thing that prevents sharp going all-in is the need to support resizing without maintaining aspect ratio. (which _shrink and _affine both support). This could be as simple as something like sharp's approach of averaging the x and y factors - see https://github.com/lovell/sharp/blob/master/src/pipeline.cc#L536"}}