Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 14-05-2011, 17:20   #91
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
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, 11:07   #92
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 12:10   #93
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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:	119
Size:	110.7 KB
ID:	27374

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

Name:	TemplateinVisNav.jpg
Views:	110
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:	114
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:	114
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, 12:16   #94
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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, 13:19   #95
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 16:05   #96
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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,
Help / FAQ 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, 20:10   #97
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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, 01:04   #98
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 10:42   #99
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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:	131
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, 12:00   #100
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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:	108
Size:	4.4 KB
ID:	27448

everything is fine.

If I do this,
Click image for larger version

Name:	TestChartPalette2colours.png
Views:	117
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, 13:13   #101
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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, 17:18   #102
Registered User
 
HappySeagull's Avatar

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

Click image for larger version

Name:	palette differences.png
Views:	114
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 17-05-2011, 00:51   #103
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 97 views)
File Type: doc imgkap2.doc (350.0 KB, 60 views)
File Type: doc imgkap3.doc (350.0 KB, 43 views)
File Type: doc imgkap4.doc (166.9 KB, 104 views)
File Type: doc imgkap.c.doc (63.2 KB, 47 views)
__________________
MdJ is offline   Reply With Quote
Old 17-05-2011, 06:44   #104
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

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

Version 1.11 ready for download:

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

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 577 11-11-2017 06:02
OpenCPN Beta Version 3.1.814 Released bdbcat OpenCPN 185 14-09-2012 08:43
Route File Transfer via SDcard to Garmin 441s four winds Navigation 11 25-02-2012 09:34
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 22:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 05:31



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 14:05.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.