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 06-04-2011, 08:41   #46
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by sailias View Post
Ok read all the material and test imkap on ubuntu. Seems to work well for what its supposed to do. If you have the time a demo on how you crop the collars would be most interesting. I think I understand what you are doing but a walkthrough with an example would be a good howto.

Many thanks in advance should you choose to do this.

/ch
ok,I found a plain example to use...I'm going to have to describe it as I do it when it comes to cropping but I know you'll be able to co-relate it to whatever image editor you use...standby!It takes awhile to get organized...
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 09:27   #47
Registered User
 
simonrdc's Avatar

Join Date: Apr 2011
Location: Cornwall, UK
Posts: 7
Re: imgkap - kap File Converter Tool

Thats excellent seagull, thanks m8! and thank you to everyone else. I'll let you know how I get on.
simonrdc is offline   Reply With Quote
Old 06-04-2011, 09:40   #48
Registered User
 
HappySeagull's Avatar

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

Sailias...ok.I've done this several times.I did this one just now.
with an old USchart 83153_1 Kingman reef wayyy out there...

First extract the tif and header with extract2edit batch
http://www.cruisersforum.com/forums/...4&d=1300118736

or just use cmd
imgkap "Thekap.kap" "Theheader.kap" "Theimg.tif"
quotes are good for names with spaces.
open the header.kap in notepad or whatever is simple...
figure out which are the four corners...you may have to think a bit but these most likely!!will obviously be the lowest/highestpixel numbers combined with lowest/highest lat/long Remember what side of the dateline you're on...and Negative signs are very important,being West or South,eh?
Note these!positions and pixels...copy and paste CAN be used
but only with caution.Better to put em in a notepad file.

in my example,
REF/1,249,300,6.4833333333,-162.5333333333 (top left)
REF/2,9116,301,6.4833333333,-162.3333333333(top right)
REF/3,9114,5841,6.3583333333,-162.3333333333(lower right)
REF/4,248,5840,6.3583333333,-162.5333333333(lower left)


...note thatwidths/heights slightly differ!Oh well,let's try anyways!...I'm going to use upper left and lower right everytime in IMGKAP so THEY will be "masters" therefore...

some arithmetic

X pixel (width)=9114-249=8865
Y pixel (height) =5841-300=5541

In irfan
Goto Edit,CreateCustomCrop, or just SHIFT+C
1)setratio=NONE
2)Xoffset=lowest Xpixel Yoffset =lowestYpixel
Width=Highest Xpixel-Lowest Xpixel
Height=HighestYpixel-Lowest Ypixel
image dpi blank worked
standard dimensions=NewSize

"save and apply"

and SAVE the cropped image as a tif uncompressed is best.



Then with imgkap,this batch " imgkap_MakeaKap.bat"
http://www.cruisersforum.com/forums/...9&d=1300046014
(which I actually use ,even if i did scribble it myself)
following its directions using the cropped image and the noted upper left and lower right corners...
the cmd line is in the first post or hack my batch....
And this is the differenceClick image for larger version

Name:	ClipboardComparison.jpg
Views:	288
Size:	48.9 KB
ID:	25909 seen with kapview
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 10:02   #49
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by simonrdc View Post
Thats excellent seagull, thanks m8! and thank you to everyone else. I'll let you know how I get on.
Please do! Any snags, shortcuts and improvements to this greedily gobbled!

Also check out map2kap(write your own "map"header?),kapview(note that kapview dumps a tiff every time and quickly shows if there's a screwup),and finally the libbsb+Map_cal2+mc2bsbh package for down+dirty streetfights,when the ammo is low but you're determined to win through!
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 11:20   #50
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by MdJ View Post
Hello Thomas,

Just a note, I do not recommend using bsbfix because editing can ruin image in file.

That's why I made the header option, the easiest way is to :

> imgkap myfile.kap header.kap myfile (. png,. tif,. ... bmp, jpg not)

Edit and modify header.kap without considering the end of line

> imgkap myfile.xxx myheader.kap mynewfile.kap

PS: I finished the issue of quantize colors, I try and add some functionality before publishing

M'dJ
M'dJ,Yes,this is working very well (right this very moment!)in a problem I have noticed with some Transverse Mercators that are crashing OpenCPN badly.(that I will post later on a different thread)...It is very fast to extract the kap as you say,change it to Mercator and even write a new "PP" in.....

The actual chart can be edited in a hex editor too,as Cagney was saying (and I have done it a lot of times,for OpenCPN 2.3!!)but it needs great caution-the Original changed from Readonly,bytes must be added,etc...
With IMGKAP I can do it without strain(so important to seagulls...).I am using my batches again but I think I'll rewrite one so it's even easier to take the Kap apart and rebuild it quick....
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 13:26   #51
Registered User
 
simonrdc's Avatar

Join Date: Apr 2011
Location: Cornwall, UK
Posts: 7
Re: imgkap - kap File Converter Tool

I'm missing something here, I've run the command mentioned in previous posts as shown in the attached cmd scr/cap and I was expecting a .kap file to pop out the other end from the tiff which I was using as source, what have I missed.....I am a fully confessed noob at this stuff guys!
how do I link pictures on here, I've attached a scr/cap all the same.
Attached Thumbnails
Click image for larger version

Name:	imgkap batch.jpg
Views:	349
Size:	183.9 KB
ID:	25914  
simonrdc is offline   Reply With Quote
Old 06-04-2011, 13:28   #52
Registered User
 
simonrdc's Avatar

Join Date: Apr 2011
Location: Cornwall, UK
Posts: 7
Re: imgkap - kap File Converter Tool

see error...I don't know what I'm doing!
simonrdc is offline   Reply With Quote
Old 06-04-2011, 16:06   #53
Registered User
 
sailias's Avatar

Join Date: Mar 2010
Location: Canada
Boat: On the Hard
Posts: 336
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by HappySeagull View Post
Sailias...ok.I've done this several times.I did this one just now.

<snip>

In irfan....
Goto Edit,CreateCustomCrop, or just SHIFT+C
1)setratio=NONE
2)Xoffset=lowest Xpixel Yoffset =lowestYpixel
Width=Highest Xpixel-Lowest Xpixel
Height=HighestYpixel-Lowest Ypixel
image dpi blank worked
standard dimensions=NewSize

"save and apply"

and SAVE the cropped image as a tif uncompressed is best.
Ok with you load and clear till we get to Infran. Where did that come from? I can edit the header as needed thats not an issue, just not sure where infran came from into the equation .

Many thanks for taking the time

/ch
sailias is offline   Reply With Quote
Old 06-04-2011, 16:11   #54
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by sailias View Post
Ok with you load and clear till we get to Infran. Where did that come from? I can edit the header as needed thats not an issue, just not sure where infran came from into the equation .

Many thanks for taking the time

/ch
Sorry! irfan is
"Irfanview" ,a graphics editor.

As I said,it's hard to describe the image editing except what I have here.Just get the results needed.I DO have a ton of 'em I've tried.It's a matter of taste but this is my choice.
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 16:34   #55
Registered User
 
HappySeagull's Avatar

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

Quote:
Originally Posted by simonrdc View Post
see error...I don't know what I'm doing!
sure you do.You've got it.EXCEPT Try it with quotes around "Portreath.png " not just "Portreath"

You only need quotes in CMD if your name has spaces.say:
Port Reath.png But it never seems to hurt,so a good habit,I think.
The quotes are there only because a space tells CMD that a new thing is coming but the quotes tell it to hold off and keep everything in the quotes together,spaces or not.

Doublechecking on my part...
You do have Portreath.png in the C:\Users\SimonRDC folder?

Also,try the batch scripts.You just download 'em and change the doc to bat.But look at them in a notepad too.That's all they really are.text files with a different tag.(extension as it's called)
Copy em into the work folder, double click and hopefully,it'll save some cmd line typing and brainstrain organizing.Also,FYI,F3 key will retype a botched cmd so you can carefully cursor back and edit.More,a right-click IN the cmd window allows pasting of copied text...

Eventually,you hopefully can find all the poop I've spread around on the OpenCPN forum,learning from the Helpful Geniuses so that even a seagull can do these simple things!!
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 16:54   #56
Registered User
 
HappySeagull's Avatar

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

Sailias,simonRDC...I still advise getting/converting whateverimage to the "correct" tif (charts 16 colour,Google earth 128 colour)before handing it to imgkap or any chartmaking at all...because that's what THEY are going to do,if you don't.But (simonrdc)keep the -n switch-it doesn't hurt and will do the job most times without considering my stodgy theories..(M'dJ is slaving in the laboratory this instant,I hear,to improve this even more!)

As far as I know,-but I can be corrected!-Charts are tifs.... a kind "Geotifs"but that's just my foggy notion.
HappySeagull is offline   Reply With Quote
Old 06-04-2011, 18:15   #57
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

Quote:
Originally Posted by simonrdc View Post
I'm missing something here, I've run the command mentioned in previous posts as shown in the attached cmd scr/cap and I was expecting a .kap file to pop out the other end from the tiff which I was using as source, what have I missed.....I am a fully confessed noob at this stuff guys!
how do I link pictures on here, I've attached a scr/cap all the same.
Instead of

"Portreath".png

try

"Portreath.png"

Same with the "Portreath".kap
dacust is offline   Reply With Quote
Old 07-04-2011, 01:42   #58
Registered User
 
simonrdc's Avatar

Join Date: Apr 2011
Location: Cornwall, UK
Posts: 7
Re: imgkap - kap File Converter Tool

surveyor/Jim in exploring google maps is there anyway you can capture the entire active window in 3600x2400 rather than just a screen cap? In other words, when you have 3600x2400 view you only see what is on the screen and not what is present in the rest of the window that you can only view by using the sliders, I wonder if theres a trick to capturing the whole active window which would include those parts of the map outside the viewport of the screen...does that make sense?
rgds
Si
simonrdc is offline   Reply With Quote
Old 07-04-2011, 07:43   #59
Registered User
 
HappySeagull's Avatar

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

simonrdc... if you have Firefox,this plugin works great.
Screengrab!
HappySeagull is offline   Reply With Quote
Old 09-04-2011, 04:02   #60
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
imgkap - kap File Converter Tool - V1.0B

New version of Imgkap 1.0B.

Installation:
Identical to version 1.0a
Correction of reducing colors :
Quantize in LibFreeImage is buggy, so after searching a code, I wrote a new method (which I name "differencial spheric") equivalent to Gimp or Infraview but better for google-earth.

This optimized method is fast, the "-n" no longer used, but remains for compatibility.

Colors in kap files are in order of frequency of use.
New options and possibilities
  • Option : -t "myTitle"
Allows you to change the title in the file kap.
By default the title is the file name or title of the header file.
  • Format of longitudes and latitudes
imgkap accepts different format -1.22 1°10'20.123N -1d22.123
  • KML file input
imgkap accepts a kml file type "Ground Overlays".
With this new possibilitie you can make a kap files directly from a KML file.
Use, for example, Atlas Mobile Creator (MOBAC) Mobile Atlas Creator (MOBAC) to make a KMZ file, then unzip the KMZ file and finally launch imgkap
> Imgkap doc.kml
KAP file generated will be named the tag "name" and will be in the same folder than image file
The title in the internal file KAP is the tag "name" unless it is specified by the-t option.
> Imgkap doc.kml-t "My sample KAP" \tmp\mykap.kap

This version is an beta version, it may still be some bugs or errors.

(Programming quantizer is )

Good uses and tests to you

M'dJ
MdJ 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:20.


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.