Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-07-2011, 14:24   #136
MdJ
Registered User

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

Quote:
Originally Posted by cagney View Post
That is, imgkap is inserting todays date, and in the wrong US format.
Todays date is 07/02/2011 in US format - don't blame me for the logic, but that is the convention.
So when the user is suppling the header file, just copy the values, please.

Thomas
Thank you very much for your help Thomas

I change my home and I have very little time to answer questions.

Actually in imgkap, I wrote the date, voluntarily ED in European format, I have to change this, check with the BSB written by SHOM in France and find one solution.

Thank you again, I would suggest a correction soon.

M'dJ
__________________

__________________
MdJ is offline   Reply With Quote
Old 19-07-2011, 20:09   #137
Registered User

Join Date: Jul 2011
Posts: 1
Re: imgkap - kap File Converter Tool

Excellent, thank you very much. I've been searching for weeks to find a way to get a kap file from my scanned chart. I was also trying SeaClear out but it would only make a wci and I prefer to try OpenCPN. All this to say I actually converted my image file to a working kap. Where I did get stuck for a few minutes was on the command line for the KAP header. It was not clear where that file came from. I used mapcal to make a cal file, then KAP-File utility to make a BSB header, renamed that from .bsb to abc.kap, tried the command for the 10th time and amazingly out popped a fine Kap file.

Sorry for the long post but to other new members, I wanted to say this works.
Gear
__________________

__________________
Gear is offline   Reply With Quote
Old 20-07-2011, 07:14   #138
Registered User
 
HappySeagull's Avatar

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

Gear,
Good oh!
By the way,you can name the header file ".txt" now ,in the newest version.This saves confusion.And,If you find time,please make a description of your own particular process here to help others...
__________________
HappySeagull is offline   Reply With Quote
Old 08-08-2011, 09:54   #139
Registered User
 
HappySeagull's Avatar

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

PS to gear...imgkap1.11 can read MapCal's output via mc2bsbh...rename the hdr file to .txt.
Windows command lines:

imgkap chartimage.bmp mc2bsbhheader.txt

name of kap will be bmp name or...

imgkap chartimage.bmp "the mc2bsbh.txt" your_choice-of-name.kap

replace bmp with png if that's the case...
MapCal only calibrates pngs and bmps for me and bmps work better when larger.

note the quotes around "the mc2bsbh.txt" This is because it has spaces in the name.Underscores and dashes are another workaround more agreeable to cmd line (as are shorter names to bad typists like me!)
you can simply edit and paste the above,into the Windows cmd window.
__________________
HappySeagull is offline   Reply With Quote
Old 08-08-2011, 10:08   #140
Registered User
 
HappySeagull's Avatar

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

Note to M'dJ?
NOT a big deal I hope and..
I'm may be a whiner but I still have a palette issue...Charts mostly go fine in OpenCPN but in Kapview(Cagney's Windows viewer) AND in OziExplorer...the palette will come up in blacks.I haven't any other apps except OZI installed anymore but there's something amiss.

The original image here was 16mil colour tif but I have had the same trouble in other image formats no matter what I try(previous color reduction in irfanview OR GraphicsMagick, etc...)Some WILL do display like this even in OpenCPN...
Click image for larger version

Name:	Clipboard01.jpg
Views:	110
Size:	84.9 KB
ID:	30274
__________________
HappySeagull is offline   Reply With Quote
Old 08-08-2011, 12:14   #141
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 more info for THIS image BUT ignore .Stay sailing ,turn off your computer!
per
tiffinfo
LIBTIFF, Version 3.8.2
Copyright (c) 1988-1996 Sam Leffler

Code:
D:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM>tiffinfo D:\MAPS\CANADA
_TOPOS\062(aroundFARM\toporama_062f13.tif
TIFFReadDirectory: Warning, D:\MAPS\CANADA_TOPOS\062(aroundFARM\toporama_062f13.tif: unknown field with tag 33550 (0x830e) encountered.
TIFFReadDirectory: Warning, D:\MAPS\CANADA_TOPOS\062(aroundFARM\toporama_062f13.tif: unknown field with tag 33922 (0x8482) encountered.
TIFFReadDirectory: Warning, D:\MAPS\CANADA_TOPOS\062(aroundFARM\toporama_062f13.tif: unknown field with tag 34735 (0x87af) encountered.
TIFFReadDirectory: Warning, D:\MAPS\CANADA_TOPOS\062(aroundFARM\toporama_062f13.tif: unknown field with tag 34737 (0x87b1) encountered.
TIFF Directory at offset 0x8 (8)
  Image Width: 4500 Image Length: 3600
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Rows/Strip: 1
  Planar Configuration: single image plane
  Tag 33550: 0.000111,0.000069,0.000000
  Tag 33922: 0.000000,0.000000,0.000000,-102.000000,50.000000,0.000000
  Tag 34735: 1,1,0,5,1024,0,1,2,1025,0,1,1,2048,0,1,4269,2049,34737,6,0,2054,0,1
,9102
  Tag 34737: NAD83|
not sure if it's useful. DON'T reply at all if you are on La Cote d'Azure!!!
I'm just dropping this here for reference...!
__________________
HappySeagull is offline   Reply With Quote
Old 08-08-2011, 20:22   #142
Registered User
 
HappySeagull's Avatar

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

No,the above is a red herring to do with Canada Topo tifs ...because I'm getting black palettes from the NGA charts too...I've tried several ways via Irfanview and GraphicMagick,
Firstly,only resized 50% to BMPS(that was so MapCal can use em)That didn't work inimgkap so I
Then reduced colours to 256...and so on through pngs and tiffs.
Well,if no-one else is having this,that's a clue!

Later...aha.Colours fixed!Got an older version imgkap1b.This works.Go figure.
The old version needs header.kap..can't use a txt file but just renaming the mc2bsbh ".hdr" to ".kap" also works fine

http://www.dacust.com/inlandwaters/i....00/imgkap.exe
Thanks,Dacust for keeping these!
__________________
HappySeagull is offline   Reply With Quote
Old 09-08-2011, 09:26   #143
Registered User
 
HappySeagull's Avatar

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

If there's ONE thing that leaps out at me,it's that my old CHS kaps and the US charts all start their colour values in tha kap file as

RGB/1,0,0,0..RGB/2,255,255,255

Code:
!Copyright 1995-1997, BSB Electronic Charts.  All Rights Reserved...VER/2.0..BSB/NA=CAPE BLANCO TO CAPE FLATTERY,NU=1651,RA=8213,10655,DU=254..KNP/SC=736560,GD=NAD83,PR=MERCATOR,PP=46.00,PI=60.000,SP=,SK=0.0000000..    TA=90.0000000,UN=FATHOMS,SD=MEAN LOWER LOW WATER,DX=73.66,DY=73.66..CED/SE=16,RE=03,ED=09/18/1993..OST/1..IFM/4..RGB/1,0,0,0..RGB/2,255,255,255..RGB/3,209,221,239..RGB/4,244,232,193..RGB/5,219,181,
imgkap (and tiff2bsb ),do not.
__________________
HappySeagull is offline   Reply With Quote
Old 10-08-2011, 02:55   #144
Marine Service Provider

Join Date: Feb 2010
Posts: 279
Re: imgkap - kap File Converter Tool

I was getting a black pallete until I used the -n switch in imgkap I first converted to png Reduced the size by 50% then used imgkap to convert to a kap file using an header file created by mcbsbh I assume the -n switch reduces the color palettte

richard
__________________
r.fairman is offline   Reply With Quote
Old 10-08-2011, 08:29   #145
Registered User
 
HappySeagull's Avatar

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

Thanks,Richard.I'll try that exact recipe...but using the just -n switch didn't work and is anyways supposed to be gone in the newer versions...
Have you tried your kaps in other apps outside of OpenCPN?(wherein my black ones work fine!it's Ozi,Kapview and whatever else they don't...)

per my theory post#143...of course I found an exception...
__________________
HappySeagull is offline   Reply With Quote
Old 10-08-2011, 11:50   #146
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by r.fairman View Post
I was getting a black pallete until I used the -n switch in imgkap I first converted to png Reduced the size by 50% then used imgkap to convert to a kap file using an header file created by mcbsbh I assume the -n switch reduces the color palettte

richard
Thanks,richard-That works...the -n switch.(see below though)
What also works are 256 bmps,127 colour tifs.Why now?

It seems important to NOT reconvert from any previously converted image... I think I did this in the mess I made in the attempts...-n switch didn't help in these.I'm still puzzled,you see.

The Canadian geo -tiffs pictured above(-that's what they were !)were not helping....I'll work on these next...
Are you testing yours outside of OpenCPN?
__________________
HappySeagull is offline   Reply With Quote
Old 10-08-2011, 12:03   #147
Registered User
 
HappySeagull's Avatar

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

can anyone help with this batch script?

Code:
@echo 
@echo a batch script to make kaps with MdJ's imgkap 1.11

FOR %%I IN ("*.tif","*.txt") DO (imgkap -n "%%~nI.tif" "%%~nI.txt") 
@pause
it works ok but it runs through twice or thrice before stopping...hmm

Click image for larger version

Name:	Clipboard01.jpg
Views:	109
Size:	54.5 KB
ID:	30342
__________________
HappySeagull is offline   Reply With Quote
Old 11-08-2011, 12:28   #148
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:
@echo  @echo a batch script to make kaps with MdJ's imgkap 1.11  FOR %%I IN ("*.tif") DO (imgkap -n "%%~nI.tif" "%%~nI.txt")  @pause
there,that works better...oh,and can replace tif with png or bmp just fine.
__________________
HappySeagull is offline   Reply With Quote
Old 06-09-2011, 06:53   #149
Registered User

Join Date: May 2011
Posts: 10
Smile Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by dacust View Post
The Windows executable can be downloaded as a single un-zipped object here:

==> imgkap - Download

It also has the imgkap.c source code.

This site will be updated sometime from a coupla hours to as much as a coupla days after a new version is posted here.

If you want the newest version right away, download the attachments posted in the post above and follow the instructions.

BUT, if you want it to be a little easier, you can download 7-Zip, and yuse the convert.cmd at the link above that will rename, combine and un-zip all at once. Just put the downloaded objects in the same directory as the convert.cmd and double-click the command.

When I get home tonight, I'll modify the page to show the date/time and link to the post of the version that was last downloaded, so it'll be obvious which one it is.

-dan
Great Job!!! Today I downloaded imgkap.exe v 1.11 and found that it did NOT work on my Win XP computer. (error message: imcap is no valid win32 program) So I tried version 1.1 and after 1 minute I had my first working .kap file for OpenCPN. It showed op nicely in OpenCPN!
Many thanks to Dan for preserving the old files and MdJ Merci Beaucoup!
Aart
(Holland)
__________________
aart is offline   Reply With Quote
Old 06-09-2011, 09:38   #150
Registered User
 
HappySeagull's Avatar

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

That's odd.imgkap1.11 worked just fine.You can rename it,substitute it and try...?
__________________

__________________
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 10:24.


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.