Author Topic: Is there a RESIZESPRITE command?  (Read 3962 times)

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Is there a RESIZESPRITE command?
« 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?
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.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Is there a RESIZESPRITE command?
« Reply #1 on: 2012-Sep-10 »
If it's not stretch nor zoom then you would have to very simply mean a crop with GRABSPRITE?

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Is there a RESIZESPRITE command?
« Reply #2 on: 2012-Sep-10 »
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.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Is there a RESIZESPRITE command?
« Reply #3 on: 2012-Sep-10 »
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?

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4142
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Is there a RESIZESPRITE command?
« Reply #4 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

I came. I saw. I played.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1766
    • View Profile
    • Homepage
Re: Is there a RESIZESPRITE command?
« Reply #5 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.
« Last Edit: 2012-Sep-10 by Moru »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Is there a RESIZESPRITE command?
« Reply #6 on: 2012-Sep-10 »
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?

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Is there a RESIZESPRITE command?
« Reply #7 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.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: Is there a RESIZESPRITE command?
« Reply #8 on: 2012-Sep-10 »
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:

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4142
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Is there a RESIZESPRITE command?
« Reply #9 on: 2012-Sep-10 »
Indeed. Now it all becomes clear. :)

Quote
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.
That's EXACTLY what I said with the CREATESCREEN/USESCREEN and SAVEBMP.
I came. I saw. I played.

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Is there a RESIZESPRITE command?
« Reply #10 on: 2012-Sep-10 »
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

  • Guest
Re: Is there a RESIZESPRITE command?
« Reply #11 on: 2012-Sep-10 »
There is a routine (probably in Code Snippets) that resizes once loaded, that may be useful...

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
Re: Is there a RESIZESPRITE command?
« Reply #12 on: 2012-Sep-11 »
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.

Offline Sixth Sense

  • Mc. Print
  • *
  • Posts: 47
    • View Profile
    • Sixth Sense
Re: Is there a RESIZESPRITE command?
« Reply #13 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.
 
Okay, It’s been more than ten years now so I confess............I let the dogs out!

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Is there a RESIZESPRITE command?
« Reply #14 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.