@@ -58,10 +58,7 @@ func precomputeWeights(dstSize, srcSize int, filter ResampleFilter) [][]indexWei
5858// filter and returns the transformed image. If one of width or height is 0, the image aspect
5959// ratio is preserved.
6060//
61- // Supported resample filters: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali,
62- // CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.
63- //
64- // Usage example:
61+ // Example:
6562//
6663// dstImage := imaging.Resize(srcImage, 800, 600, imaging.Lanczos)
6764//
@@ -218,10 +215,7 @@ func resizeNearest(img image.Image, width, height int) *image.NRGBA {
218215// Fit scales down the image using the specified resample filter to fit the specified
219216// maximum width and height and returns the transformed image.
220217//
221- // Supported resample filters: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali,
222- // CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.
223- //
224- // Usage example:
218+ // Example:
225219//
226220// dstImage := imaging.Fit(srcImage, 800, 600, imaging.Lanczos)
227221//
@@ -262,10 +256,7 @@ func Fit(img image.Image, width, height int, filter ResampleFilter) *image.NRGBA
262256// Fill creates an image with the specified dimensions and fills it with the scaled source image.
263257// To achieve the correct aspect ratio without stretching, the source image will be cropped.
264258//
265- // Supported resample filters: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali,
266- // CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.
267- //
268- // Usage example:
259+ // Example:
269260//
270261// dstImage := imaging.Fill(srcImage, 800, 600, imaging.Center, imaging.Lanczos)
271262//
@@ -344,40 +335,29 @@ func resizeAndCrop(img image.Image, width, height int, anchor Anchor, filter Res
344335// Thumbnail scales the image up or down using the specified resample filter, crops it
345336// to the specified width and hight and returns the transformed image.
346337//
347- // Supported resample filters: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali,
348- // CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.
349- //
350- // Usage example:
338+ // Example:
351339//
352340// dstImage := imaging.Thumbnail(srcImage, 100, 100, imaging.Lanczos)
353341//
354342func Thumbnail (img image.Image , width , height int , filter ResampleFilter ) * image.NRGBA {
355343 return Fill (img , width , height , Center , filter )
356344}
357345
358- // ResampleFilter is a resampling filter struct. It can be used to define custom filters.
359- //
360- // Supported resample filters: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali,
361- // CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.
346+ // ResampleFilter specifies a resampling filter to be used for image resizing.
362347//
363348// General filter recommendations:
364349//
365350// - Lanczos
366- // High-quality resampling filter for photographic images yielding sharp results.
367- // It's slower than cubic filters (see below).
351+ // A high-quality resampling filter for photographic images yielding sharp results.
368352//
369353// - CatmullRom
370- // A sharp cubic filter. It's a good filter for both upscaling and downscaling if sharp results are needed .
354+ // A sharp cubic filter that is faster than Lanczos filter while providing similar results.
371355//
372356// - MitchellNetravali
373- // A high quality cubic filter that produces smoother results with less ringing artifacts than CatmullRom.
374- //
375- // - BSpline
376- // A good filter if a very smooth output is needed.
357+ // A cubic filter that produces smoother results with less ringing artifacts than CatmullRom.
377358//
378359// - Linear
379- // Bilinear interpolation filter, produces reasonably good, smooth output.
380- // It's faster than cubic filters.
360+ // Bilinear resampling filter, produces a smooth output. Faster than cubic filters.
381361//
382362// - Box
383363// Simple and fast averaging filter appropriate for downscaling.
@@ -412,7 +392,7 @@ var CatmullRom ResampleFilter
412392// BSpline is a smooth cubic filter (BC-spline; B=1; C=0).
413393var BSpline ResampleFilter
414394
415- // Gaussian is a Gaussian blurring Filter .
395+ // Gaussian is a Gaussian blurring filter .
416396var Gaussian ResampleFilter
417397
418398// Bartlett is a Bartlett-windowed sinc filter (3 lobes).
0 commit comments