Commit Graph

122 Commits

Author SHA1 Message Date
jst
45c239597b Fix compile error. 2015-03-25 20:23:07 +01:00
jst
beee5e27fe Add support for nearest-neighbor resize of NRGBA, NRGBA64 images. 2015-03-25 20:20:28 +01:00
jst
79dc2b616d Add functions for nearest-neighbor resize of NRGBA, NRGBA16. 2015-03-25 20:17:14 +01:00
jst
ebea2e66be Support image.NRGBA, image.NRGBA16 in resize.Resize function. 2015-03-25 18:47:07 +01:00
jst
daa7cf45d3 Return NRGBA images.
Resizing images with alpha channels is easier for NRGBA, NRGBA64 image types.
Support for these is added by providing the necessary resize functions.
2015-03-25 18:38:23 +01:00
jst
53e9ca890b Fix typos. 2015-03-18 20:19:43 +01:00
jst
4b952c4b95 Merge branch 'charlievieth-master' 2015-03-18 19:57:50 +01:00
jst
d67851ed1f Explain optimization. 2015-03-18 19:56:53 +01:00
Charlie Vieth
962e93a6e5 Merge branch 'optimization' 2015-03-15 18:01:18 -04:00
Charlie Vieth
076a9ce3b9 Limit spawned goroutines to GOMAXPROCS(0).
This change sets the number of spawned goroutines to the GOMAXPROCS
value set by the user.

Using more goroutines than available execution threads is slightly
detrimental to performance (~0.5%), and prevents users of the library
from controlling the number of spawned goroutines.
2015-03-15 17:59:38 -04:00
Charlie Vieth
d8255b0421 Optimize bound checks.
Optimizing the bound checks resulted in an overall 14% increase in
conversion performance.
2015-03-15 17:44:39 -04:00
Charlie Vieth
b09281bd36 Update benchmarks to focus on conversion performance.
Benchmark each interpolation function for RGBA and YCbCr images.
Reduce the image size used when benchmarking to reduce the influence of
memory performance on results.
2015-03-15 17:40:38 -04:00
jst
8f44931448 Merge branch 'master' of https://github.com/nfnt/resize 2014-12-17 11:23:53 +01:00
jst
9485f5475a Return input image if output dimensions equal input dimensions. 2014-12-17 11:10:53 +01:00
jst
87b3f9b017 Merge pull request #23 from dlackty/patch-1
Use SVG version badge for Travis CI
2014-12-03 19:40:17 +01:00
Richard Lee
f49722caca Use SVG version badge for Travis CI 2014-11-21 17:00:51 +08:00
jst
7e2ce0a2ea Go >=1.1 is needed for this package. 2014-10-24 14:47:00 +02:00
jst
13ea1287b3 Test using all available versions of Go. 2014-10-24 14:41:49 +02:00
jst
20c6afea04 Remove unnecessary benchmark 2014-09-15 11:58:05 +02:00
jst
0c6a628df5 Resolve image artifacts due to wrong coefficient index lookup. 2014-09-15 11:50:59 +02:00
jst
581d15cb53 Fix parallel computation. 2014-08-20 21:12:39 +02:00
jst
e950449c49 Fix wrong boundary calculation (bug #17)
This fix doesn't currently work concurrently. This will be fixed in another commit.
2014-08-20 20:54:59 +02:00
jst
03982f698d Merge branch 'charlievieth-master' 2014-08-13 20:13:24 +02:00
jst
220cad3343 Add simple test case for input image with non-trivial bounds. 2014-08-13 20:12:18 +02:00
jst
7f8a5419ae Merge branch 'master' of https://github.com/charlievieth/resize into charlievieth-master 2014-08-13 20:10:38 +02:00
Charlie Vieth
df655f3f70 Merge branch 'YCC' 2014-08-12 16:11:40 -04:00
Charlie Vieth
08b124d541 Fix bound out of range panic. 2014-08-12 16:11:25 -04:00
Charlie Vieth
171c886e38 Merge branch 'YCC' 2014-08-12 14:41:55 -04:00
Charlie Vieth
f03c78969b Fix YCC SubImage. 2014-08-12 14:41:20 -04:00
Charlie Vieth
3c164b34f4 Merge branch 'YCC' 2014-08-12 14:22:17 -04:00
Charlie Vieth
acea8646b2 Fix error in YCC PixOffset and SubImage. 2014-08-12 14:22:06 -04:00
jst
ccddecd1bf Merge branch 'charlievieth-master' 2014-08-05 18:01:45 +02:00
Charlie Vieth
a5a6a66088 Merge branch 'refactor' 2014-07-30 02:09:28 -04:00
Charlie Vieth
eefd4737aa Optimize YCbCr image resize 2014-07-30 02:08:58 -04:00
Charlie Vieth
ee540982e0 Merge branch 'refactor' 2014-07-29 18:48:50 -04:00
Charlie Vieth
427b8d133e Optimized Nearest-Neighbor function - 2x faster 2014-07-29 18:32:58 -04:00
Charlie Vieth
80b3fc2b3f Pre-calculate start offset, optimize bound check
Increased performance by 30% for RGBA and 45% for Gray images, minor
performance increase for 16-bit images.

The start offset calculated by createWeights are stored in a slice and
passed to the resize functions to prevent duplication of effort.
2014-07-29 16:53:35 -04:00
jst
be07665345 Update README.md 2014-07-19 14:00:14 +02:00
jst
299762ed77 Add unit tests for converter.go 2014-07-19 13:31:16 +02:00
jst
016a61cd31 Optimize data-locality for a huge increase in processing speed.
This is a complete rewrite! The tight scaling loop needs data locality for optimal performance. The old version used lots of pointer redirections to access image data which was bad for data locality. By providing the complete loop for each image type, this problem is solved. Unfortunately this increases code duplication but the result should be worth it: I could measure a ~6x speed-up for certain test cases!
2014-07-19 13:19:31 +02:00
jst
bdfbbead13 Merge branch 'anisus-master'
Fixes #14, regression from 494d8de4e5
2014-06-18 19:05:59 +02:00
Accipiter Nisus
f3cac2f865 Fix to resize correctly when source image.Bounds().Min is not (0,0) 2014-06-16 13:53:36 +10:00
jst
8aee0d995b Update README.md to mention resize.Thumbnail. 2014-01-30 20:03:15 +01:00
jst
079ed2e48a Merge branch 'master' of https://github.com/matrixik/resize into matrixik-master 2014-01-30 19:40:14 +01:00
jst
a83cb40860 Remove some redundancies. 2014-01-28 19:53:26 +01:00
jst
446eea2f7b Remove LUT based filters.
Caching kernel weights makes using the LUT based approach obsolete. Now they seem to be even slower than their counterparts.
2014-01-28 18:54:57 +01:00
jst
9884534579 Cache kernel weights for each row.
For each row the convolution kernel is evaluated at fixed positions around "u". By calculating these values once for each row, a huge speedup is achieved.
2014-01-28 18:48:08 +01:00
jst
8f586c4f06 Add benchmarks to compare execution times.
Run "go test -bench LargeJpegThumb" to benchmark all functions at once.
2014-01-18 11:55:34 +01:00
jst
45368ad0cd Multiply instead of dividing 2014-01-17 23:14:37 +01:00
jst
314cea6612 Avoid temporaries to save some cycles. 2014-01-17 22:54:15 +01:00