Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.
Trekbuddy is on Github now

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
optimized script for GIMP

 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Tools
View previous topic :: View next topic  
Author Message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5676

PostPosted: Tue Jan 09, 2007 3:26 pm    Post subject: optimized script for GIMP Reply with quote

by Dmitry Astapov:

"Trying to convert OziExplorer map for TrekBuddy, I noticed that GIMP script for splitting maps into smaller chunks is very unoptimal. GIMP is forced to produce a fresh copy of entire map image for each chunk, while leads to never-ending swapping.

I rewrote the script to make it more robust. Using it, I splitted map of Kiev (15000x14000 60-color PNG) into 172x220 chunks in about 20 minutes (1Gb RAM, 2GHz Pentium IV). Old script barely managed to produce 5-6 map pieces during this time."



ot2gps.zip
 Description:
optimized tile-cutting script for GIMP

Download
 Filename:  ot2gps.zip
 Filesize:  1.02 KB
 Downloaded:  688 Time(s)

Back to top
View user's profile Send private message
guest



Joined: 08 Oct 2006
Posts: 5035

PostPosted: Mon Jan 22, 2007 12:56 pm    Post subject: Reply with quote

Hi there,

I'm new in this topic and at all story with k750i gps. Could you please give me a link for those soft and scripts mentioned before in your message.

I'm trying to use my own city map Rijeka-Croatia, but have some problems. First I'm not able to copy those map files to directory location as mentioned in "how to" description.

I'm using WindowsXP operating system, so I need help for software able to be install on it.

One thing more, I can not stop sound and vibrator when k750i is connected with GPS receiver. I'm using BT-308.

Any chance to help me ?

Thanks in advance
Damir Petrinic
I'm sorry to use GUEST username as my account is not activated yet.
Back to top
View user's profile Send private message Visit poster's website
Ranger



Joined: 12 Dec 2006
Posts: 6030

PostPosted: Mon Jan 22, 2007 1:03 pm    Post subject: Reply with quote

Hi Damir,

If you would prepare maps, there is better tool now, Duffa's TB cutter.
You can find it in Tools section on forum.

Sounds effects are typical for situation, when you didn't turned on Bluetooth interface in phone first, before connecting GPS from TB.
Back to top
View user's profile Send private message
guest



Joined: 08 Oct 2006
Posts: 5035

PostPosted: Mon Jun 11, 2007 5:12 am    Post subject: map-cutting script for Linux & Macs Reply with quote

First of all, kudos to kruch for this great program!

I have an alternative map cutting solution for the Linux/Mac crowd to contribute back to the effort: the attached "pnmtotb" shell script. Its advantages over the "gimp" method are:
- far faster and more efficient, and higher quality output (esp. better color reduction)
- does the whole job: produces compressed, color-reduced TB map from image (JPEG, PNG, GIF, TIFF, ...) + .map file
- non-interactive command: easy to batch-process an entire collection

It uses the "netpbm" package which is standard with many Linux installations, and which I highly recommend for batch image processing. To use:
1. install the attached "pnmtotb" shell script somewhere in your command path (the ".txt" extension is just to satisfy the forum software)
2. edit it to set your desired tile size and number of colors (the values in the script are what I use for my Z550i)
3. Let's say you have a JPEG image "fiji.jpg" and the "fiji.map" file for it. In that case run "jpegtopnm fiji.jpg | pnmtotb fiji". The resulting "fiji.tar" file is your compressed TB map (ta-dah!)

Some more explanation: the first part of the above command, "jpegtopnm", simply converts the JPEG into netpbm's own "pnm" format, which is what "pnmtotb" takes as input. Netpbm contains such converters for many formats. If you had a TIFF, for instance, the command would be "tifftopnm fiji.tif | pnmtotb fiji". The "fiji" argument to pnmtotb is the name of the map; it means that the script loooks for "fiji.map" and produces "fiji.tar". (The image can actually be called something else, just give it to the converter as argument.)

Enjoy,

- nic
Back to top
View user's profile Send private message Visit poster's website
supik



Joined: 05 Nov 2006
Posts: 26

PostPosted: Fri Nov 09, 2007 3:49 pm    Post subject: Reply with quote

Hi, I tried gimp + the script, because I do have problems running tb cutter..

but when I run the script I get the following error message>



OT2Gps Message

Error while executing
(ot2gps 1 500 600 1 256)

Error: set!: unbound variable: width
Back to top
View user's profile Send private message
oldman



Joined: 12 Sep 2007
Posts: 8

PostPosted: Fri Dec 14, 2007 5:42 pm    Post subject: Re: map-cutting script for Linux & Macs Reply with quote

guest wrote:

I have an alternative map cutting solution for the Linux/Mac crowd to contribute back to the effort: the attached "pnmtotb" shell script. Its advantages over the "gimp" method are:
- far faster and more efficient, and higher quality output (esp. better color reduction)
- does the whole job: produces compressed, color-reduced TB map from image (JPEG, PNG, GIF, TIFF, ...) + .map file
- non-interactive command: easy to batch-process an entire collection
- nic



This was really a good solution for Linux . Thank you !!!
Back to top
View user's profile Send private message
guest



Joined: 08 Oct 2006
Posts: 5035

PostPosted: Thu Feb 14, 2008 7:53 pm    Post subject: Reply with quote

Hi, i have same problem as supik. Exists any solution? Thx.
Back to top
View user's profile Send private message Visit poster's website
ave



Joined: 02 Dec 2006
Posts: 16
Location: Finland

PostPosted: Tue Mar 04, 2008 12:01 pm    Post subject: Reply with quote

The problem is that gimp 2.4 has changed the scheme interpreter/implementation introducing some incompatibilities.

I'm fixing the script and I'll provide diff/script later here unless the original author gets to it first.


Last edited by ave on Tue Mar 04, 2008 6:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
ave



Joined: 02 Dec 2006
Posts: 16
Location: Finland

PostPosted: Tue Mar 04, 2008 5:42 pm    Post subject: New OT2GPS-version for testing Reply with quote

Hi.

Here is a modified version of the gimp tiling-script. Tested with gimp v2.4.2.

I changed atleast the following:
- input parameter labels are in english
- by default the script produces non-indexed bitmaps
- compatible with new tinyscheme interpreter (tiny-fu)
- currently only works properly with input files that have 3 character file extension (png, jpg, gif) due to missing string-search function in tinyscheme

IMO the reduced colormap images look really bad and are nearly unusable. Here's some size-statistics with my test-map (24-bit, ~22000 unique colors, 4.6 MB png)

24-bit 4.2M
256c 2.5M
16c 1.3M
10c 1.2M

My phone (SE k800) can manage large tiles and 24-bit colors nicely, for other models and brands I have no idea. Please experiment.



ot2gps.zip
 Description:
OT2gps new version

Download
 Filename:  ot2gps.zip
 Filesize:  1.07 KB
 Downloaded:  311 Time(s)

Back to top
View user's profile Send private message
Kiikonen



Joined: 01 Apr 2008
Posts: 9

PostPosted: Thu Apr 03, 2008 9:10 am    Post subject: Reply with quote

I had problems with the TBcutter, probably because of Vista, so i tried the masochist-style in map cutting.

I downloaded the updated script, but the input parameters are still in checz language which I don't understand at all. (In fact I think I found out all the others except "prekryti".) I'm having the same error message as the people earlier in this thread.

Do I have to do something more than just copy the script to the right folder and run it? Or is this just due to Windows Vista? At this moment I have absolutely no possible way to use any custom maps in TrekBuddy!
Back to top
View user's profile Send private message
ave



Joined: 02 Dec 2006
Posts: 16
Location: Finland

PostPosted: Sun May 11, 2008 5:51 am    Post subject: Reply with quote

You must be having/running the old script somewhere as the labels come from the script directly. No idea about vista though.
Back to top
View user's profile Send private message
dezedien



Joined: 03 Mar 2011
Posts: 4

PostPosted: Thu Mar 03, 2011 9:53 am    Post subject: thanks Reply with quote

meric
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Tools All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group