English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 24 November 2014, 09:47   #1
jimmy2x2x
Beyond Mutton
 
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 52
Posts: 347
Most effective way of converting sprites /bobs

Is there anything out there that will rip multiple sprites or bobs at various coordinates and sizes to a raw format? I wrote a script driven utility a long time ago, but It's lost to the Sands of time... I've seen a couple of utils that will convert them one at a time, I'm looking for something that can do a screen full of various sizes at once. Thanks
jimmy2x2x is offline  
Old 24 November 2014, 11:40   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
You can try it with bmp2raw from the released Solid Gold sources (tools/bmptoraw.c). It's a portable ANSI-C program. Runs everywhere.

It can cut out multiple BOBs or sprites from a picture in BMP format. BOBs are extracted in interleaved format, with optional mask generation. The picture width has to be a multiple of the BOB or sprite width you want to extract.

Example to extract a maximum of 64 masked font characters of the size 16x20 with 32 colours (5 planes) from a BMP picture:
Code:
bmptoraw menufont16.bmp 16 20 5 MASK 64 > menufont16.bin
menufont16.bin will contains all 64 objects one after another (interleaved, mask appended to each object).

There are many other options. Like for example NOMASK (no mask generation), SPRITE (output sprite data), CMAP (write the picture's RGB4 colour map), etc..

The source:
Attached Files
File Type: c bmptoraw.c (13.5 KB, 155 views)
phx is offline  
Old 24 November 2014, 12:05   #3
Apollo
Registered User
 
Apollo's Avatar
 
Join Date: Sep 2008
Location: Germany
Age: 49
Posts: 137
@phx:
Which program did you use for creating the BMPs? Grafx2?

I'm asking because I had the problem that some of the paint tools I used in the past didn't save the colors in the order which were shown in the programs palette (and the indexed format was "wrong" in my point of view). After trying some tools I came back using DPaint IV from within the emulator.
Apollo is offline  
Old 24 November 2014, 12:33   #4
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Yes, I'm mostly using GrafX2 and Gimp, although only for minor changes, as I'm no graphician. My brother used Gimp for all Solid Gold graphics, and the Retroguru graphicians use other programs, which I forgot.

I had no problems with GrafX2 and Gimp exporting BMP so far. Although with later Gimp versions you have to make sure to untoggle generation of true-color BMPs during the export, even when your image is indexed.
phx is offline  
Old 24 November 2014, 17:25   #5
jimmy2x2x
Beyond Mutton
 
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 52
Posts: 347
That sounds like a great start! Thanks. Does anyone have a compiled windows binary, I'm on mobile Internet following a house move and can't afford to download a compiler right now.
jimmy2x2x is offline  
Old 24 November 2014, 17:56   #6
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 771
Here is the leftover Windows exe from compiling the Solid Gold game. Be forewarned of the unapproved addition to phx's code. This was because the file redirection syntax used in some tools caused LF CR character to be output after before every CR LF in the io. Net result was an 885k ADF and a funny-looking owl on the boot screen.

Code:
#include <fcntl.h>
_setmode(_fileno(stdout),_O_BINARY);
Attached Files
File Type: zip bmptoraw.zip (6.9 KB, 117 views)

Last edited by clenched; 26 November 2014 at 04:34. Reason: correct inaccurate explanation
clenched is offline  
Old 24 November 2014, 19:21   #7
jimmy2x2x
Beyond Mutton
 
jimmy2x2x's Avatar
 
Join Date: Mar 2011
Location: North West, UK
Age: 52
Posts: 347
Thank you sir, I will try it out later
jimmy2x2x is offline  
Old 24 November 2014, 20:16   #8
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Apollo View Post
I'm asking because I had the problem that some of the paint tools I used in the past didn't save the colors in the order which were shown in the programs palette (and the indexed format was "wrong" in my point of view). After trying some tools I came back using DPaint IV from within the emulator.
I'm guessing MS Paint was one of them?

I have drawn my own super-sized palette tables, one contains the index numbers whilst the other has the colour values in RGB format

http://www.aliensrcooluk.com/public/...lourValues.PNG


I didn't quite finish the indexing (yet), but so far I only use 16 colour images (usually in bitmap or PNG format).
Lonewolf10 is offline  
Old 25 November 2014, 10:13   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by clenched View Post
This was because the file redirection syntax used in some tools caused LF character to be output after every CR in the io.
Wow... indeed! I didn't think about that.

When using stdout then there is no portable way to guarantee binary output. I should better open a new file in binary mode for it...
phx is offline  
Old 26 November 2014, 16:19   #10
Apollo
Registered User
 
Apollo's Avatar
 
Join Date: Sep 2008
Location: Germany
Age: 49
Posts: 137
Quote:
Originally Posted by Lonewolf10 View Post
I'm guessing MS Paint was one of them?

[...]

I didn't quite finish the indexing (yet), but so far I only use 16 colour images (usually in bitmap or PNG format).
Thank you. No, I didn't tried MS Paint. I remember having the problem with BMPs exported from Gimp. Using the indexed palette mode in Gimp gave me headaches any way. I was too lazy reading the howto's carefully enough. Then I stepped back to GrafX2 (which is a fine program).
Back in the day I wanted to convert rendered logos with GIMP into an indexed format. But I failed because I wanted to 'sort' the colors before exporting into BMP. Really, I miss 'butcher'.
Apollo is offline  
Old 27 November 2014, 18:22   #11
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 771
This is the first time I've taken a close look at these tools independently. All sorts of fun trinkets to play with.

Maptapper with grid switched on is a good way to make sure the graphics will look as expected. This is phx's example. Repeat the command with CMAP to make a palette that can be loaded by Maptapper. Color 0 has been fudged a little so everything is visible.
Attached Thumbnails
Click image for larger version

Name:	SlicedNDiced.png
Views:	284
Size:	38.0 KB
ID:	42314  

Last edited by clenched; 27 November 2014 at 19:41.
clenched is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not so fancy but effective fractal landscape generator Morbane request.Apps 14 17 December 2014 03:41
Background Image and Bobs!! Sparticle Coders. General 3 29 July 2013 11:22
Most cost-effective RAM upgrade for A1200? Kenan support.Hardware 1 06 May 2013 07:27
FS: Various bits n bobs jujasi MarketPlace 0 12 July 2009 19:13
Bobs Garden Big-Byte Amiga scene 7 26 October 2002 11:24

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:54.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.16917 seconds with 14 queries