Commit Graph

41 Commits

Author SHA1 Message Date
John Cupitt d3cafb3a9f seems to work
add @centre option for downsampling, see

https://github.com/jcupitt/libvips/issues/504
2016-09-10 10:31:33 +01:00
John Cupitt 1f403a4add first attempt
seems to all work, test it a bit more

see https://github.com/jcupitt/libvips/issues/491
2016-08-15 15:45:26 +01:00
John Cupitt 65105a9442 upsize with something other than nearest
vips_resize() uses to just use nearest when upsizing, following standard
practice in repro. This is often unfortunate for image processing, where
small nearest upsizes will produce obvious aliasing.

It now picks a VipsInterpolate which corresponds (roughly) to the
selected VipsKernel and uses that with affine for any upsizing.
2016-06-22 10:33:08 +01:00
John Cupitt f3326c8126 better vips_resize() for cubic/linear/nearest
vips_resize() used to do most of a downsize with vips_shrink() and the
final 200 - 300% with vips_reduce(). This was correct for lanczos2/3,
but not right for linear/cubic, which need more shrink and less
reduce to avoid aliasing.

This patch makes vips_resize() leave the final 100 - 200% to
vips_reduce() for linear/cubic, and leave everything to reduce for
nearest.
2016-06-16 09:46:02 +01:00
John Cupitt 948d1103d4 note more webp tests needed 2016-05-07 19:53:00 +01:00
John Cupitt 1ae92bb15f make optional args into bullets
make docs easier to read
2016-05-02 10:12:37 +01:00
John Cupitt 02821ae9e3 expose @kernel setting for vips_resize()
a new optional arg lets you pick the downsizing kernel
2016-05-01 12:33:49 +01:00
John Cupitt c2d1de9a26 allow mixed zoom and shrink in resize
vips_resize() now allows >1 on one axis, <1 on the other ... previously,
although you could have non-square ratios, you couldn't mix zoom and
shrink
2016-05-01 12:03:13 +01:00
John Cupitt 36e0b60ffa put the resize cache back again
stops overcomputation on vips_shrink()
2016-03-22 14:35:44 +00:00
John Cupitt 46a18118c6 works! 2016-03-15 16:46:18 +00:00
John Cupitt ff88087a28 try making the reduce mask larger with residual 2016-03-15 14:59:59 +00:00
John Cupitt 45c3fea6ac more resize tuning 2016-03-15 09:49:30 +00:00
John Cupitt ac4e5ce059 return of shrink-less-affine-more
though a bit less extreme
2016-03-14 14:58:02 +00:00
John Cupitt fba2ac2f85 fix sizing issues with new reduce code
a couple of bugs and some changed conventions
2016-03-13 17:44:24 +00:00
John Cupitt f12fef4aa9 fix compile 2016-03-13 11:35:35 +00:00
John Cupitt 70db9aa77b better rounding in resize 2016-03-12 13:14:34 +00:00
John Cupitt 493482c8a7 hey ho, line cache goes back too 2016-03-11 14:56:06 +00:00
John Cupitt 08e8c27e38 moore vips_resize() tuning
put back the mild post-shrink sharpen, a little more anti-alias

see https://github.com/jcupitt/libvips/issues/404#issuecomment-195297607
2016-03-11 10:17:41 +00:00
John Cupitt 5d31d8e824 turn up anti-alias for small shrinks
a little more anti-alias for small reductions

see https://github.com/jcupitt/libvips/issues/404#issuecomment-195276154
2016-03-11 09:25:33 +00:00
John Cupitt 2ca7b29214 better gauss mat generation 2016-03-10 22:01:55 +00:00
John Cupitt 4974a1ed9c better rounding for vips_resize()
we were getting off by one size errors
2016-03-10 19:53:05 +00:00
John Cupitt d351e07a6b finish up 2016-03-10 17:33:34 +00:00
John Cupitt ad7ddc4f24 more vips_resize() tuning
now we have better tuning for the anti-alias blur, we can increase the
amount we shrink by and reduce the amount we affine by

this gives a noticable speedup
2016-03-01 11:19:30 +00:00
John Cupitt 67f3ecfd8d wire up to resize / similarity
still need tests
2016-01-29 15:23:00 +00:00
John Cupitt 3bb24f2567 some tinkering
still not very quick
2016-01-28 09:33:32 +00:00
John Cupitt 1f93efd65d fix more compiler warnings 2016-01-26 16:41:03 +00:00
John Cupitt a7d889df06 use builtin floor / ceil
get rid of FAST_PSEUDO_FLOOR, add VIPS_FLOOR and VIPS_CEIL, use them
everywhere

see https://github.com/jcupitt/libvips/pull/372
2016-01-23 09:50:57 +00:00
John Cupitt 2620f3b8c9 allow non-square vips_resize()
in a very crude way
2015-11-19 17:09:18 +00:00
John Cupitt 8506ff13a6 try to improve vips_resize() quality
small improvements to vips_resize() quality:

* turn down the anti-alias filter a little so we don't smudge out texture
* don't do the final sharpening pass if we skipped the anti-alias filter
* fix a >/>= mixup which meant we didn't sharpen for small resizes
2015-11-19 15:22:23 +00:00
John Cupitt 4c51f5b36d tune cache sizes a bit more 2015-11-11 13:00:25 +00:00
John Cupitt d94a2807c9 smarter cache sizing for vips_resize
see comment in code, should now account for max delay possible
2015-11-11 10:23:50 +00:00
John Cupitt a345a517c1 add docs note
note that when resizing, xres/yres need to be updated by the application
2015-02-25 08:47:45 +00:00
Lovell Fuller 8fbe8c36fa Resize builder uses 7 temp images
Prevents memory leak and possible segfault
2015-01-22 13:27:52 +00:00
John Cupitt d9709119fa oop, leak in vips_resize()
see https://github.com/jcupitt/libvips/issues/217
2015-01-21 13:17:39 +00:00
John Cupitt 0eca68a088 fix vips_resize() C API
oops, see https://github.com/jcupitt/libvips/issues/223
2015-01-21 09:05:36 +00:00
John Cupitt 384a5e05dc change parameters of vips_gaussblur()
sorry :-(

The old param (passing sigma*2 as an int) were just too confusing
coming from other packages. This new behaviour matches ImageMagick, and
almost everyone else in the world.

A new optional param lets you set the minimum amplitude as well.
2014-11-19 12:27:26 +00:00
John Cupitt 2a4f56ff9f notes 2014-11-19 09:51:52 +00:00
John Cupitt 77d5bd8d08 add sharpening step to vips_resize() 2014-11-18 21:39:29 +00:00
John Cupitt 589e15b8a4 better vips_resize() 2014-11-18 18:37:19 +00:00
John Cupitt 6f8b5c6745 bring the rest of the API into python 2014-09-05 23:18:16 +01:00
John Cupitt fe7bd9bdcc add vips_resize()
a wrapper over affine that just scales ... much faster from the
command-line, since it can set SEQ mode
2014-08-13 13:57:52 +01:00