[Tool]Snip'n'Stitch v4

Ask questions, discuss ideas, get answers
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: [Tool]Snip'n'Stitch v3

Post by fo0k »

well certainly no high priority.. but, if you do look at it..

I'm interested to stitch together large images.. so perhaps 16 x 16 x 4096 (65536x65536 output image)

sound do-able?
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: [Tool]Snip'n'Stitch v3

Post by Senshi »

Certainly doable. Just not now. Size doesn't matter, it's Java..."just" gotta do setup all the coding. Stitch is almost entirely unrelated to Snip, so it's a whole new project to tackle, really.
Pigauchiu
Posts: 31
Joined: Fri Mar 30, 2012 1:00 pm

Re: [Tool]Snip'n'Stitch v3

Post by Pigauchiu »

Senshi wrote:Thanks for spotting that, fook, fixed it :) .

Stitch....didn't hear anyone calling a need for it, so I froze that feature. Especially as it would mean a whole lot of new work ;) . If demand exists, it might come someday, but don't expect any serious for the next 4 weeks, I'm in the process of moving (out of Germany, even if just barely...) and finally really ending my studies and all that entails quite a bit of work and stress.
sad to hear that, I come for stitching pictures in fact. :|

finally v3 starts on my machine
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: [Tool]Snip'n'Stitch v3

Post by Senshi »

That's all what I needed for motivation to get this done, Pigau...someone actually having a use for the Stitch feature...

Version 4 is released. Download either via the auto-updater or the link in the first post. Changelog can be found in the first post as well.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: [Tool]Snip'n'Stitch v4

Post by fo0k »

thanks for this, been wanting to try some stitching. 8-)

when I run this version

It hangs for maybe 20 seconds with egg timer.. every time I launch the jar... then runs..

I loaded up a folder to stitch - png files - The preview looks good - then hit stitch - after a few seconds the app closes but no file is created. have tried both bmp and png output

this is how the settings look after last attempt, fyi.

Code: Select all

#
#Mon Jun 10 11:56:24 BST 2013
nosegy=
nosegx=
stitch_format=BMP
stitch_naming=Tx<*x>x<*y>
leadzero=1
stitch_in=C\:\\Users\\fo0k\\Desktop\\forstitch
naming=Tx<x>x<y>
stitch_out=C\:\\Users\\fo0k\\Desktop\\forstitch\\full.bmp
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: [Tool]Snip'n'Stitch v4

Post by Swaffy »

Is it because of the double backslashes in the output file path?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: [Tool]Snip'n'Stitch v4

Post by Senshi »

Run the tool from the cmd console with "java -jar SnipnStitch.jar"
If the tool crashes, it should give you a (cryptical) error message. Post that here.

How many and how big (resolution) are your images? I'm afraid the program is not yet really optimized memory-wise, so it might just run out of memory. But if that happens, it happens when generating the preview, not when exporting.

Double backslash are common in most programming languages, as the "\" String has to be escaped (so the compiler doesn't interpret it as one of its "active" symbols). Just like ":" and """ have to be escaped too if used in Strings.

EDIT: If you spot a "heap out of memory error" or similar in the error mesage, you can try using the "-Xmx 4096" parameter on your startup command to manually assign more RAM to java for this app.
E.g.
java -Xmx8192m -jar SnipnStitch.jar

Obviously you should not assign more RAM than you have available on your computer ;) . Best check the free memory with Task Manager before.

I just tested what happens if I load a 32000x18000 jpg image (5MB compressed, 1,7GB uncompressed) for the snip function. While it does work with Xmx8000, it takes almost a minute to load and occupies about 10 GB of memory (starts to dump to HDD, which seriously slows down any subsequent perfomance obviously).
This probably means that I have some serious problem with the way I do the image handling. I did check for memory leaks, but I probably will simply have to employ more memory-efficient (but less comfy) Image I/O methods.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: [Tool]Snip'n'Stitch v4

Post by fo0k »

great thanks, ill try this and report back..

I was trying to stitch a 16384x18384 (16x16x1024)

have since tried with smaller and did work so perhaps a size thing. there is an existing stitch tool out there which im sure you have seen which is ok with 16384 but fails if bigger. Its bigger that would be good here.. 65536x65536 stuff. This sounds too big for a single merge in the average ram capacity out there, but paging is fine really for these tasks. speed less important.. stability and size are the nice to haves for a tool like this.

an option to start without preview would be good.. would help with start up responsiveness where there are existing paths to a directory of many files
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: [Tool]Snip'n'Stitch v4

Post by Senshi »

Yeah, I already thought about optionally disabling previews for images. But the way the tool currently works it needs the preview. It's a bit choppy solution, really. I'll work on that somewhere in the next days, but I'll still have to figure out a way to read/write only sub-regions of images without first loading the entire image. That's what currently happens and that's what causes the big memory pile and slowdown.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: [Tool]Snip'n'Stitch v4

Post by Apache Thunder »

Does this tool handle 16384x16384 images? Was trying to split one into segments with this tool since the stock tgasplitter doesn't seem able to handle anything larger then 8192x8192. When I go to open the source image, the java app just closes without an error and then refuses to open until I delete the settings txt file. (since it seems to default to loading the previous image used) If not, point me to one that can. Since I was trying to add the detail layers to a map in my BFH'42 mod.

I figured out how the detail layers in the BF2/BF2142 engine work and I had tiled 6 different detail layers using each RGB channel of the Tx00x00_1 detail maps as the alpha layer for each detail texture. To prevent detail loss I had tiled them at 16384x16384 and wanted to split to Tx04x04 (4x4 segments for this map).

The resulting files would be 4096x4096 each. But the stock tgasplit app only outputs garbage and it seems unable to handle the larger resolution and your app just closes without any error message. :(

EDIT:

Ok it seems to work now. Turned out I just need to use the 64 bit version of Java to start this. (Java didn't update the "path" so the bat file/commands didn't work unless I pointed them directly to the location of the Java binary). But it still fails to open my 16384x16384 image. Still running out of memory? Despite trying to assign 4GB of ram to it. I guess my 6GB of installed ram is still not enough for it.

Looks like I need to find someone with more ram to split this for me. :(

EDIT2:

Nevermind. Turns out it doesn't support TGA files (despite you mentioning that it supported opening them?). Used BMP format and it finally opened. I noticed in task manager that I run out of physical memory and it proceeds to page swap/use virtual memory. Interesting. (it took awhile to open, so I checked on it in task manager)
ImageImageImage
I have cameras in your head!
Post Reply