disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.22k stars 433 forks source link

how can we resize image #151

Open lilei10101010 opened 2 years ago

lilei10101010 commented 2 years ago

Hi buddy , My Code is :

src2,_:=imaging.Open("./screen.png") //screen.png is px is 160*60 imaging.Resize(src2,320,120,imaging.Lanczos)

err = imaging.Save(src2,"./example02.png")

it can`t work , example02.png also is 160*60

how can i resize the bigger image ?

disintegration commented 2 years ago

Hi, The Resize function returns the new (resized) image. Try changing the second line this way:

src2 = imaging.Resize(src2, 320, 120, imaging.Lanczos)
lilei10101010 commented 2 years ago

It`s okay , thanks buddy !

vunguyen1989 commented 6 months ago

Hi @disintegration , I have used imaging for sometimes, and faced an issue when resizing images.

It's corrupted, resulting image in grey blocks as following attachment. Can you please tell me what is the root cause? Thanks a lot.

image