Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] What exactly happens to the image when you resize it to its own size?

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 14th Sep 2019 12:08
My code goes like this:

But this change the images appeareance, even after I have rendered to the image it a second time.
I have set the image to this:

So it should upsample somewhat softly giving the low-resolution pixel image a natural blur when sized up. However, The image gets much sharper if I resize it to its own size! What strange voodoo is this?

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Sep 2019 23:49
It depends on your virtual resolution
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 15th Sep 2019 10:09
Really? Sounds slightly crazy!

if I have a 64x64 image, and I resize it to 64x64, how does virtual resolution influenc that?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Sep 2019 21:40
Sorry. My bad. For some reason i thought you were using RenderToImage()
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 16th Sep 2019 09:57
oldX = getImageWidth (renderImg)
oldY = getImageHeight (renderImg)
ResizeImage( renderImg, oldX, oldY)

Here's the result. The difference is subtle, but it's there:

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 16th Sep 2019 18:54 Edited at: 16th Sep 2019 19:13
This post has been marked by the post author as the answer.
Quote: "What strange voodoo is this?"


Alpha Blending the pixels in the original image (alpha compositing), and not blending in the resize function (255 for all alpha).

Something you can play with when using the image/memblock commands...

CreateMemblockFromImage( memID, imageID )

CreateImageFromMemblock( imageID, memID )

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 16th Sep 2019 20:30
Thanks, that was it exactly! I fixed it by adding a background-colored sprite behind the text when I rendered it to the image

Login to post a reply

Server time is: 2024-11-22 16:51:14
Your offset time is: 2024-11-22 16:51:14