Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 14-05-2011, 16:20   #91
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Re: imgkap - kap File Converter Tool

Download .exe or source, including previous version. With documentation.

==>imgkap - Download
dacust is offline   Reply With Quote
Old 15-05-2011, 10:07   #92
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: imgkap - kap File Converter Tool

Thank you all, sailorF54, HappySeagull and dacust.

Convert from kml to kap was very interresting with MOBAC, Mobile Atlas Creator (MOBAC), but rights issues, it is not possible to make satellite maps now. You do find old version on WEB.

Another solution would be to use WorldWind, World Wind JAVA SDK which is copyright-free, but make an application takes many work and time.

I also had a request to use directly imgkap in another program, I wait a return, but there is no problem, either in the form of shared library, DLL on Windows, or by compiling directly width imgkap.c

The ideal is to make code portable across all systems ...

(HappySeagull, my English is pathetic and I should use the translator)

Regards.

M'dJ
MdJ is offline   Reply With Quote
Old 15-05-2011, 11:10   #93
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

Code:
Quote:
Originally Posted by MdJ View Post
Thank you all, sailorF54, HappySeagull and dacust. Convert from kml to kap was very interresting with MOBAC, Mobile Atlas Creator (MOBAC), but rights issues, it is not possible to make satellite maps now. You do find old version on WEB. Another solution would be to use WorldWind, World Wind JAVA SDK which is copyright-free, but make an application takes many work and time. I also had a request to use directly imgkap in another program, I wait a return, but there is no problem, either in the form of shared library, DLL on Windows, or by compiling directly width imgkap.c The ideal is to make code portable across all systems ... (HappySeagull, my English is pathetic and I should use the translator) Regards. M'dJ
...Better than mon Francais!and I apologise for my not-so-plain English.I can't help it!

The new version is very useful!I am just starting!

But,
I have a question about ....Palettes?or is it something else.
Here are some examples of a homemade chart.
SCREENGRABS:

Here it is in OpenCPN....it works fine.
Click image for larger version

Name:	TemplateinOpenCPN.jpg
Views:	230
Size:	110.7 KB
ID:	27374

Here it is in VisNav....not so good
Click image for larger version

Name:	TemplateinVisNav.jpg
Views:	211
Size:	87.2 KB
ID:	27375

Here it is in Cagney's Kapview....not so good
Click image for larger version

Name:	TemplateinKapview.jpg
Views:	218
Size:	61.5 KB
ID:	27373

I also tried OziExplorer,too with a bad result.

Here are the originals

HeaderEX.txt.doc

Click image for larger version

Name:	templateChartPalletteEX.png
Views:	194
Size:	8.0 KB
ID:	27376

The palette here is 16colours that I got from an extracted tif But I tried the same with 24bit and 8bit colours... I tried several image editors:Irfanview,Adobe Elements and Faststone,Xnview...

...so what's happening?It's nice to use the chart in OpenCPN but why won't it work in other apps?
HappySeagull is offline   Reply With Quote
Old 15-05-2011, 11:16   #94
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

Oh,and here's the kap!

templateChartPalletteEX.kap.doc
HappySeagull is offline   Reply With Quote
Old 15-05-2011, 12:19   #95
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by HappySeagull View Post
The palette here is 16colours that I got from an extracted tif But I tried the same with 24bit and 8bit colours... I tried several image editors:Irfanview,Adobe Elements and Faststone,Xnview...

...so what's happening?It's nice to use the chart in OpenCPN but why won't it work in other apps?
My goal is to make code compatible with all software, except that I do not own VisNav Software and Other ...

Analysis:
The image appears correctly, no scratches or error, but the colors are not correct.
For example, with tiff2bsb, it happens to have black stripes, in this case there is an error kap cuts pixels.
Here it is not the case, so this is a problem color palette.
Problems :
You'r Kap file contain 8 colors, and before you say 16 colors, in this case (2,4,8,16,32,64 and 128 colors), imgkap generates color RGB\0, but it is not accepted by libbsb and many software.
Origin :
I think this error is historic, the code tests the value 0 for the end of the line, but it makes it unusable color 0.
tiff2kap and now imgkap gets around this problem and writes the file kap one pixel of color 0 and not directly 0.
However most software is based on the original error, which limits to 127 colors in kap, 128 - the color 0
Solution :
Add or remove a color for not having a total 2,4,8,16,32,64,128 different colors.
In this case, the latest version of imgkap not generate the color 0, begin at 1.

I can also add an option to imgkap for this, however, this option limited to 127 colors and shoed bigger files.
Regards

M'dJ
MdJ is offline   Reply With Quote
Old 15-05-2011, 15:05   #96
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

Merci,M'dJ,

Md'J,do you have Cagney's "kapview"?
http://opencpn.avnisoft.co.za/util/kapview3.rar
(from Nohal's post,
http://www.cruisersforum.com/forums/...tml#post625526 and above)
For me it's been a very good indicator on Windows XP whether a kap is "good" and will work in other software....

...Here is an imgkap kap that works perfectly in the other software.
testEX.kap.doc

and the header is

Code:
RGB/0,23,23,23
RGB/1,34,39,81
RGB/2,64,66,68
RGB/3,97,157,71
RGB/4,98,104,96
RGB/5,101,114,186
RGB/6,106,110,128
RGB/7,156,179,204
RGB/8,161,147,150
RGB/9,163,189,89
RGB/10,186,208,160
RGB/11,201,206,24
RGB/12,210,173,157
RGB/13,214,213,209
RGB/14,227,164,107
RGB/15,240,238,232
see? it has "RGB/0 so I misunderstand?
HappySeagull is offline   Reply With Quote
Old 15-05-2011, 19:10   #97
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

Aha! I'm getting it....you meant the old,OLD version -the one with "Neural" colour conversion....oui,it begins at RGB/1 in the header and that's why my very simple homemade kaps do display in kapview,Ozi,old old VisNav...!

Here's what it is,I think.....
Even though my example in the post above works in kapview etc despite the "RGB/0",if I begin with a blank image,or a two colour one, and then add a few colours to it...as though painting,it fails and displays a black background because of the first entry,RGB/0,also being the background colour.No matter what I do,(so far)or how many colours...
BUT,if I capture a screen,(with a dis-ordered ,multiple palette of many colours!) it works fine...this must be because if the RGB/0 is not being read and displays as black,it is not noticed.It is likely not the most common colour in the image anyways.....could that be it?

hmm.I have a few ideas to test this..

Boy,was that a good idea,but it doesn't seem to work.Now i can't make a "bad" kap!Cripes.
HappySeagull is offline   Reply With Quote
Old 16-05-2011, 00:04   #98
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: imgkap - kap File Converter Tool

The option '-n'exists in the latest version of imgkap but is not documented.

I checked in libbsb, RGB/0 turns black.
It is easy to verify by making a KAP in 2 colors.

I think that most software is not working with KAP in 2 colors (IFM/1).

I propose to change option '-n' to produce a KAP file without RGB/0, this reduces the colors to 127 maximum and minimum IFM/2, but this should make it compatible with other software ?

M'dJ
MdJ is offline   Reply With Quote
Old 16-05-2011, 09:42   #99
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

hmmm.I actually have a Canadian Hydrographic Chart (1996) kap in two colours.

379501originalB+WEX.txt.doc

Click image for larger version

Name:	379501originalB+WEX.jpg
Views:	267
Size:	434.2 KB
ID:	27446

M'dJ,I'm going to try,the -n switch on my "problem" kaps.
HappySeagull is offline   Reply With Quote
Old 16-05-2011, 11:00   #100
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

I think I found something.You've heard me say that before

When I extract the B+W image from the "real" chart I show above,with imgkap,the 16 colour palette is in it!...even though it is really just 2 colours!

B+Wchartpalette.pal.doc

But making a homemade painted kap,imgkap only writes a palette of the colours actually in the image into the header.
If I create an image as 16 colours but only use 2,imgkap sees only 2 and does not write the embedded palette from the image into the header.It only writes what you or I would see.

If I do this
Click image for larger version

Name:	TestChartPaletteall.png
Views:	176
Size:	4.4 KB
ID:	27448

everything is fine.

If I do this,
Click image for larger version

Name:	TestChartPalette2colours.png
Views:	206
Size:	2.6 KB
ID:	27449

and make a kap,it fails.Even though both have a 16 colour palette embedded in the image.
Try it?(I was able to download these from the forum as correct size but it is 1024x616 to suit OpenCPN if you can't)
cmd line:
imgkap TestChartPaletteall.png 49.506478 -124.838820 49.480322 -124.772093

PS "-n" didn't help.
HappySeagull is offline   Reply With Quote
Old 16-05-2011, 12:13   #101
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

M'dJ,
All this is not a big problem!...I just need to use more colours when I paint on a blank canvas as a chart...
It is interesting ,is all How many people will ever do this and then expect to see the chart in a very old navigation program? Not many!And they ALL work in OpenCPN!

If I extract a chart image,paint on it and rebuild with the extracted header,everything is ok
If I make a chart ,from a scan or a screen capture using the command line,everything is ok

so don't worry!
HappySeagull is offline   Reply With Quote
Old 16-05-2011, 16:18   #102
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

Click image for larger version

Name:	palette differences.png
Views:	479
Size:	22.3 KB
ID:	27470
better? example? This is not the same kap as above. It's another I was testing.
The imgkap extracted tif palette is left(gauche) side and are the colours seen in the kap by opencpn(but not in kapview,correctly).The original tif before making the kap is the palette on right (droit)side.All these colours do not all appear in the original tif.

of course,I could be totally wrong,too.That's a "given",eh?
HappySeagull is offline   Reply With Quote
Old 16-05-2011, 23:51   #103
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by MdJ View Post
The option '-n'exists in the latest version of imgkap but is not documented.

I checked in libbsb, RGB/0 turns black.
It is easy to verify by making a KAP in 2 colors.

I think that most software is not working with KAP in 2 colors (IFM/1).

I propose to change option '-n' to produce a KAP file without RGB/0, this reduces the colors to 127 maximum and minimum IFM/2, but this should make it compatible with other software ?

M'dJ
Version 1.11 same as 1.1

Now option "-n" is modified to force KAP begin at colors 1 (max 127).

You can use -n option with all other option to produce KAP file

HappySeagull, try with VisNav...
> imgkap first.kap -n result.kap

Regards
Attached Files
File Type: doc imgkap1.doc (350.0 KB, 148 views)
File Type: doc imgkap2.doc (350.0 KB, 88 views)
File Type: doc imgkap3.doc (350.0 KB, 79 views)
File Type: doc imgkap4.doc (166.9 KB, 134 views)
File Type: doc imgkap.c.doc (63.2 KB, 81 views)
MdJ is offline   Reply With Quote
Old 17-05-2011, 05:44   #104
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Re: imgkap - kap File Converter Tool

Version 1.11 ready for download:

imgkap - Download
dacust is offline   Reply With Quote
Old 17-05-2011, 09:33   #105
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: imgkap - kap File Converter Tool

I rewrote the helpfile for myself.A bunch of easy notes I'm afraid I'll forget without it!might help others?
NEWImgKap1.1.txt.doc

might be out of date now with newest version!
HappySeagull is offline   Reply With Quote
Reply

Tags
imgkap


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Development Debugging Environment - Setup Help rgleason OpenCPN 654 04-10-2020 05:37
OpenCPN Beta Version 3.1.814 Released bdbcat OpenCPN 185 14-09-2012 07:43
Route File Transfer via SDcard to Garmin 441s four winds Navigation 11 25-02-2012 08:34
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 21:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 07:26.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.