Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can we resize image #151

Open
lilei10101010 opened this issue Oct 23, 2021 · 3 comments
Open

how can we resize image #151

lilei10101010 opened this issue Oct 23, 2021 · 3 comments

Comments

@lilei10101010
Copy link

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
Copy link
Owner

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
Copy link
Author

It`s okay , thanks buddy !

@vunguyen1989
Copy link

vunguyen1989 commented Feb 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants