Is there a RESIZESPRITE command?

Previous topic - Next topic

spicypixel

Just looking for a command to physically resize a sprite image, not stretch or zoom for screen viewing but resizing for saving?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

matchy

If it's not stretch nor zoom then you would have to very simply mean a crop with GRABSPRITE?

spicypixel

Just need to load a jpg resize it and save it out. Never need be displayed on screen. Any ideas?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

matchy

Any ideas? I've suggested on command but your query is unclear because resizing requires stretching and zooming. What are you really trying to achieve?

Ian Price

So you want to load a .JPG, not display it, but alter it's physical size (but not alter the image by scaling)?

Why not just do that with an image editor? - even MSPaint can do that.

Failing that, use either GRABSPRITE (as Matchy suggested) or paste the image onto a virtualscreen made with CREATESCREEN & USESCREEN. Then you can use SAVEBMP with the resulting image.

:S

I came. I saw. I played.

Moru

#5
Quote from: spicypixel on 2012-Sep-10
Just looking for a command to physically resize a sprite image, not stretch or zoom for screen viewing but resizing for saving?

I think the key part of this question is "not stretch or zoom for screen viewing" = stretch for saving instead of viewing. This should be possible by creating a new sprite with the target size, set this as active output and paint the original sprite on the new sprite with the correct sizes. Don't ask me for code examples, I'm more than a year away from coding GLBasic so can't remember at all, just that it should be possible this way :-)

Don't suggest "Why don't you use X/Y program instead, much faster." You don't know what the reasons for this is. I would for example need this because the target user is unable to use anything more complicated than an automatic camera. The resizing, cropping and uploading my application has to take care of for the user.

matchy

SP's question if not silly, it's just that I don't understand it because I am pretty sure the solution seems simple. I mean, what is the difference from stretching and resizing?

spicypixel

Quote from: Ian Price on 2012-Sep-10
So you want to load a .JPG, not display it, but alter it's physical size (but not alter the image by scaling)?

Why not just do that with an image editor? - even MSPaint can do that.

Failing that, use either GRABSPRITE (as Matchy suggested) or paste the image onto a virtualscreen made with CREATESCREEN & USESCREEN. Then you can use SAVEBMP with the resulting image.

:S

GrabSprite only uses the backbuffer and as I mentioned I don't want to draw it to a screen. I guess I could load it, use StretchSprite and Paste it to a screen created with Usescreen, but I asked is there a way to resize the image. StretchSprite and RotoZoom commands retain the original size and don't physically resize the image. As Moru suggested I need this so the user doesn't have to.

Basically I'm reading images from a camera SD card, resize them (batch) to be stored tempoararily, so I can load the reduced filesize versions for viewing and then quickly cycle through them, waiting for 6Mb files to load each prev/next is not a happy experience, nor is loading many and having the ram overhead. Once I have selected the files within my app to transfer then I can do the copying :)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

matchy

Now I understand that you want to create thumbnails for images larger that the screen size.  :bed:

Without using the graphic driver createscreen, perhaps SPR2MEM with some sort of magical bit shifting could do it!  :whistle:

Ian Price

Indeed. Now it all becomes clear. :)

QuoteI think the key part of this question is "not stretch or zoom for screen viewing" = stretch for saving instead of viewing. This should be possible by creating a new sprite with the target size, set this as active output and paint the original sprite on the new sprite with the correct sizes.
That's EXACTLY what I said with the CREATESCREEN/USESCREEN and SAVEBMP.
I came. I saw. I played.

spicypixel

I sorted it with USESCREEN and just saved the sprite number created from CREATESCREEN with SAVESPRITE. Woop :-)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrTAToad

There is a routine (probably in Code Snippets) that resizes once loaded, that may be useful...

Wampus

Quote from: spicypixel on 2012-Sep-10
I sorted it with USESCREEN and just saved the sprite number created from CREATESCREEN with SAVESPRITE. Woop :-)

I think this is ideal. Alpha channel information is perfectly scaled if dealing with PNGs too.

Sixth Sense

 I just use the free photo editor 'Photoscape' to batch re-size all images from my camera when I'm sorting out a new set of pics. I just leave it running in the background and get on with something else till it's finished.
Okay, It's been more than ten years now so I confess............I let the dogs out!

spicypixel

Quote from: Sixth Sense on 2012-Sep-12
I just use the free photo editor 'Photoscape' to batch re-size all images from my camera when I'm sorting out a new set of pics. I just leave it running in the background and get on with something else till it's finished.

I can play a number of games on my pc but it doesnt stop me writing my own :D Sorry SS just kidding with you, I need to perform other tasks after importing my images so it needs a custom app, but thanks anyway.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.