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 / Is there anyone know how to use Image Joiner?

Author
Message
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 17th Oct 2011 12:16
when I use it ,I find that the image order In the whole image is not as my expected.

I rename the images with the number,such as 1,2,3,4..... but it is useless.

give my best
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Oct 2011 16:18
It provides a sub image text file which can be used to load the images by name. Personally I find this utility pretty useless for creating animated sprite sheets where you want them all in order. I'm making my own.

Once it's working nicely I'll upload it for anyone to use, unless someone beats me to it...

The Slayer
Forum Vice President
14
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 17th Oct 2011 16:42
It does work if you number your images backwards.
Also, you have to fill the dozens with zeros. For instance, an image named 'image1.png', must be written 'image01.png'.
It's best to number the first image 99, and count down to number the following images. Then it works.

Cheers

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th Oct 2011 19:30
Baxslash if you're doing something better, I would be very grateful if you would share.

What I am looking for right now is a tool that scans all the sprite images, and removes any extra transparent borders there might be, because artists like to do their art in fullscreen size without caring to crop! And cropping manually with a paint tool is taking me ages!!!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Oct 2011 00:06
Quote: "Baxslash if you're doing something better, I would be very grateful if you would share."

I just have something I'm using to make sprite sheets from images and models but it's far from perfect and currently designed to do a few specific jobs for my current WIP.

It doesn't crop edges automatically but you should be careful of doing that with animated spritesheets as they will not be centred correctly.

PNG images are not much larger in filesize when uncropped anyway, or are you combining all of your in game art into atlas sheets? I started doing some nesting algorithms but my head is full to the brim at the moment and I gave it a rest on that problem for a while. Nesting unevenly shaped images automatically is a bit of a puzzle...

Email me an example of what you're spending ages doing and I'll see if I can help.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th Oct 2011 17:12
My problem is that the artist sent me all sprite animation frames in 1024 by 768, even if there is only a small 60 by 64 sprite! That's the way his animation software outputs.

As you suggested, the cropping software has to be intelligent, check all spite files, and cut to the largest frame size, and be able to leave the pixels in the same position to not loose centering.

Sounds complicated. I think I will have to write some sort of converter tool myself as I have almost 100 files to process!!!!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Oct 2011 17:32
If you send me 4 images I'll have a go if I get time... might be able to give you a few shortcuts

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th Oct 2011 22:14
I will. Thanks a lot
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Oct 2011 23:39
Hi all, I have thought about doing a program for this since trying the image joiner and finding it pretty horrible. After seeing this post last night I thought I'd finally get round to doing one. Its basic but should work ok as far as I've tested it.


It won't auto crop images it just scans its root directory for .png files. Then asks you to type the name. Just use the name and not the image number or file extension. So for "man1.png" use "man", then type in the extension next, so ".png". I was going to support multiple file types but couldn't be bothered in the end, so that could be altered. Once you have entered that, it should tile your images and save to the sprite_sheet directory.

If anyone wants to improve on it they are welcome.

@Bjadams, for auto cropping images to the smallest possible size, try jasc animation studio, which comes with psp 7. It is an old but fairly useful tool. The only problem you may have is it doesn't seem to work with transparencies too well, and you may end up with black backdrops rather than clear ones.
You should find it here as it is now free to use. I paid about £70 for it when it was new and spangly lol.
http://download.cnet.com/windows/

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Oct 2011 10:54
I'm still waiting for those images but my spritesheet tool will do transparent backgrounds. I can easily make it crop your images for you too. I'll make a special version for you, post the code and a working version here...

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 19th Oct 2011 17:12 Edited at: 19th Oct 2011 17:12
As you can see from the attached file, the various frames that make up the character animation are all different widths and heights.

So the crop tool must first scan all frames, compute the widest possible width and height to cover all frames, then remove the extra transparency, and KEEP the character centred in the same position.

After this first stage of processing, then the frames are packed into the agk spritesheet format

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Oct 2011 17:25
Quote: "So the crop tool must first scan all frames, compute the widest possible width and height to cover all frames, then remove the extra transparency, and KEEP the character centred in the same position."

That will mean you have to set the sprite size every single frame... you'd be better sticking with a set size for the sprite to a power of 2 IE. 64, 128, 256 and then manually deciding where the 'square' sits in relation to your images.

Allow me to finish the changes I've already made for you... you'll loose next to nothing in terms of memory and make your code much simpler.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Oct 2011 21:52
Of course the image joiner tool does none of this. I just wrote an improved basic grabber without creating a textfile(not even sure exactly what all the data is in that file anyway). That will save the images in the right order rather than seemimngly all over the place as the current one does. As for cropping centering and stuff, I do that manually normally and tbh 100 images is not a lot. I have waded through more than that in the last few days.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 20th Oct 2011 00:59
if the image joiner does not put frames in the proper sequence, does this mean the the spites will not play correctly?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 20th Oct 2011 04:43
From my experience, no, they won't. It works for a strip, but if you have multiple rows it messes up. So all my sprite sheets I have made manually so far. I'm not sure about the backwards number count thing, but I wouldn't be happy doing that myself. My little snippet does the same job (in DB) as image joiner, but it puts them down in the correct order( or at least from my tests it did ). It saves to a power of 2 image but doesn't check the individual ones.

I don't suppose it would take too much to check the pixel colour of each image, work out the crop positions, and then try to center the cropped image to a ^2 sprite of the nearest size. It would only work for certain sprites of course.

We will have to wait and see what baxslash is working on for that, or if I get time I will look at my snippet again. At least my snippet can tile already cropped images in the meantime. As I said before, animation shop is good for cropping images in one fell swoop. It can auto crop or you can set the crop ranges yourself. But it is a bit old now. Actually, setting the crop range yourself would solve the issue of sprites cropping wrongly for sprites that move around within the sprites frame.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 10:59
Quote: "if the image joiner does not put frames in the proper sequence, does this mean the the spites will not play correctly?"

You have to manually grab the animation frames from the sheet using the "loadSubImage" command. You just select the name of the original individual image IE."frame_01.png" and the command finds it using the text file data to grab the right part of the image.

I'm having a strange crash with Image Kit at the moment. Once I've figured that out I should have something for you.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 12:56
Here's a full project including the compiled EXE.

Should be easy enough to mess around with. Uses Image Kit V2, cloggy's D3D and Matrix Utility plugins... maybe more but I think not.

Hope it helps!

Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 20th Oct 2011 13:11
DVader, yes the tool has to check the pixel colour of each image, work out the crop positions from left, right, top and bottom, and then crop the image to the largest area size without doing any fancy centring so the sprites will stay in the exact same position and play right.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 13:12 Edited at: 20th Oct 2011 13:50
My pleasure...

Making an autocrop function now...

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 14:45 Edited at: 21st Oct 2011 15:40
OK I've updated it to autocrop the images for you too now...

It will autocrop transparent images up to the minimum size in order to keep a centre position for the images.

You're more than welcome

Download!

Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 20th Oct 2011 17:09
Baxslash, seems like your tool does exactly what I needed!

Thanks a lot.

However I came across a problem when converting large-sized sprites. The first 2 sprites are ok, but from the third sprite onwards, the sprite image is showing superimposed on the previous sprite!!! Seems like the background is not being cleared...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Oct 2011 17:16
Quote: "However I came across a problem when converting large-sized sprites. The first 2 sprites are ok, but from the third sprite onwards, the sprite image is showing superimposed on the previous sprite!!! Seems like the background is not being cleared..."

Can you post the images for me to test?

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Oct 2011 15:23
I colour coded the test sprites to make the problem more apparent. it seems that the background is not being cleared as multiple sprites are being pasted on top of each other.
strangely enough the first 2 sprites are always fine.

size & crop wise all seems great!

thanks

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Oct 2011 15:35
I'll take a look...

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Oct 2011 15:42
Fixed: Updated download!

Also I fixed the spelling mistake... not quite sure what "Autocroping" is but it sounds rude

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Oct 2011 16:57
unfortunately the problem is still there only the first 2 sprites are ok
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Oct 2011 17:40
Try this version, it might be the problem. If not then I'm very confused... works fine here.

Attachments

Login to view attachments
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 21st Oct 2011 18:52
The image joiner does not really work well on the mac. I joined my images on windows then tried to use them on the mac iPod and got strange results.

Go through yourself at a wall.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Oct 2011 22:08
Baxslash unfortunately the problem is still persistent. I am testing it against the coloured sprite tests I attached in the previous psot
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 01:03 Edited at: 22nd Oct 2011 01:06
I think there may be a graphics card specific problem here.

Would it help if I provided a version that allowed you to select a 'background' colour that didn't use the image kit?

You would have to choose a colour that would be easy to delete afterwards in an image editor.

EDIT: Just to prove it works on my system here's the spritesheet I get using those images


Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Oct 2011 09:09
Yes it seems like it works on your side.

I am using Nvidia GTX 260 with latest drivers. Are you on Nvidia too?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 10:54
Yes, a but much older card...

I'll have another look. See if I can't make a better version.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Oct 2011 14:18
Personally I think that transparency is a MUST have
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Oct 2011 14:24
Could it be a looping problem?

the first 2 sprites, red and green are ok.

the third sprite is drawn pasted on top of the first red sprite.

the fourth sprite is drawn pasted on top of the second green sprite.

etc etc
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 18:54
I'm resetting the image kit every loop so I don't see how that could happen.

Have you played with the code yourself to try to fix it? It's kind of hard for me since I can't reproduce it...

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Oct 2011 22:25
Since i don't use darkbasic pro & the addons it uses its a bit hard for me to understand 100% what is going on
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 22:40
I see... I'll take another look but I can't reproduce the error so I can't be sure until you try it yourself.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2011 22:48 Edited at: 26th Oct 2011 10:47
OK try this version. It draws to a new render image each time and resets the image kit more times than I've had hot dinners.

If this doesn't work I'll be shocked and surprised...

Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Oct 2011 23:19
Sorry, problem is still persistent.

I took a look at the code, remarked the lines where temp files are deleted, to check the temp files.

It seems that the problem is related to ImageKit plugin not your code.

I am using Windows7, I ran the exe in WinXp compatibility mode, but still same problems
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Oct 2011 00:10
I'll keep trying other things, maybe I can still do the same thing using the bitmap commands but I haven't managed it yet...

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Oct 2011 01:30
the problem is in the part where you are creating & saving the temp files.

the strange thing is that sprites 1 & 2 are fine, but sprite 3 onwards are keeping the previous image and not clearing. it looks like a problem with ImageKit.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Oct 2011 06:14
I have a very useful utility to join images together. I want to share it. but I don't how to . can anyone help?

give my best
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Oct 2011 08:47
Halley, When posting a message here, just click ATTACHMENT: CHOOSE FILE
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Oct 2011 09:43
the wonderful tool is here . let's download it.

sometimes it's much better to join images together.

give my best

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Oct 2011 10:34
Any chance of a translation? I can't understand the buttons... maybe I can guess...

halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Oct 2011 11:51
导入PNG序列图片: import png files
导出为单个图片: export to a png file
排列方式: arrange direction:
横向排列合并:horizen combine
竖向排列合并:vertical combine
导出时自动设置行列:auto calculate the count of row and line
导出成功后打开: open the png file when combined
清空列表: remove all png files
移除: remove a png file

give my best
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Oct 2011 16:04
Halley if you plan to make this tool public, would it be a lot of work to make an option to choose language between english & chinese?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 10:48
I've made a few slight changes to the code, would you mind testing whether it works now?

Download

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 26th Oct 2011 23:53
Baxslash, works FANTASTIC now!
You can'r imagine how many hours your tool is going to save me!

Just for the sake of curiosity, what was the problem?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Oct 2011 00:29
That's great!

I heard on another thread that I a similar problem was solved by adding a "CLS 0" before pasting new images.

2 lines of code added

Often that's all it takes, the hard part is ALWAYS knowing what those 2 lines are

Login to post a reply

Server time is: 2024-04-23 08:37:46
Your offset time is: 2024-04-23 08:37:46