Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Robert Engels
That’s assuming the image is displayed. It is easier to keep portions of the image on disk with certain formats (eg tiled). > On May 11, 2020, at 2:40 PM, Robert Engels wrote: > > That means there is a memory leak. Once an image is decoded it takes the > same amount of memory based on resolu

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Robert Engels
That means there is a memory leak. Once an image is decoded it takes the same amount of memory based on resolution and bit depth. > On May 11, 2020, at 11:59 AM, Vivi wrote: > > It will make sense when you change PNG to JPG and loop 100x to see the > actual memory consumption with grtme -v .

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Vivi
It will make sense when you change PNG to JPG and loop 100x to see the actual memory consumption with grtme -v ... -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email t

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Robert Engels
I’m sorry but that makes no sense. Do you mean file size is smaller? Depends on jpeg compression options. It can be many times smaller than a png. > On May 11, 2020, at 10:22 AM, Vivi wrote: > >  > > I found a snippet, memory usage with PNG vs JPG (more than 2x memory than PNG) > https://gis

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Vivi
I found a snippet, memory usage with PNG vs JPG (more than 2x memory than PNG) https://gist.github.com/logrusorgru/570d64fd6a051e0441014387b89286ca Why does JPG consume more memory? Is it fine to have libvips as a dependency for content management system in the same way as PHP require with Ima

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Nick
Quoth Vivi: > How do you advice to resize and crop JPEG and PNG or probably WebP images > without rely on 3rd parties dependencies? > > It was hard to find a good snippet or could be useful to have basic API > function in Go standard library since it's a common feature. I'd encourage you to consi

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Randall O'Reilly
https://github.com/anthonynsimon/bild has parallel image ops of all sorts and is widely used & well supported. - Randy > On May 10, 2020, at 9:52 PM, robert engels wrote: > > I don’t know and I doubt anyone else does off the top of their head, so why > don’t you write a test and see? > > Ima

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
I don’t know and I doubt anyone else does off the top of their head, so why don’t you write a test and see? Image processing is highly image and usage dependent, e.g. acceptable quality vs. speed vs. memory. Using non-quantifiable terms like “huge” is not testable nor verifiable. > On May 10,

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Vivi
How does it compare to vipsthumbnail that utilize low memory usage which I believe it use horizontal threading, does Go's image/draw package consume large memory if the image source is huge? On Monday, 11 May 2020 07:00:11 UTC+8, Nigel Tao wrote: > > On Mon, May 11, 2020 at 4:28 AM robert enge

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
My bad, I didn’t read the API docs completely. Kind of a strange interface declaration in the stdlib image package - that there is only a single rectangle for Draw() and it is bounded by the two images. > On May 10, 2020, at 5:57 PM, Nigel Tao wrote: > > On Mon, May 11, 2020 at 4:28 AM robert

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Nigel Tao
On Mon, May 11, 2020 at 4:28 AM robert engels wrote: > All of the code to do scaling and cropping in the ‘image’ package in the > stdlib. Cropping is in the stdlib but scaling is not. Various scaling algorithms (e.g. nearest neighbor, Catmull-Rom) are in the golang.org/x/image/draw package inste

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
All of the code to do scaling and cropping in the ‘image’ package in the stdlib. You ‘draw’ into a new image to do scaling. You use SubImage() to perform cropping. See https://blog.golang.org/image-draw Alternatively, if you need more advanced scaling operations it would be fairly trivial to po

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Michael Jones
I have an extremely elaborate resizing library, but it is so complex it would not make sense as a standard tool for common uses. (Many convolution kernels, separate windows, forward and backward mapping, separable convolutions, upsampling first for Nyquist issues, strategy phase and then concurrent

[go-nuts] Image Resize and Crop

2020-05-10 Thread Vivi
How do you advice to resize and crop JPEG and PNG or probably WebP images without rely on 3rd parties dependencies? It was hard to find a good snippet or could be useful to have basic API function in Go standard library since it's a common feature. -- You received this message because you are