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 15-10-2012, 01:32   #1
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Compress large Tif-charts

I have a number of 20-40 meg tif-files with sea-charts, probably meant for printing.

Would somebody know how to compress them to acceptable sizes for use in Opencpn.

I have access to gdal/gdal_translate, I have tiffcp, I have Irfanview and also mapc2mapc.

My knowledge of graphical file-formats is limited. And also, my 3 MB memory often results in 'too little memory' or similar message.
oem is offline   Reply With Quote
Old 15-10-2012, 08:44   #2
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Compress large Tif-charts

oem, I'm assuming you want to convert these tiffs to kaps for O?

the conversion to a kap format IS a "compressed" format. I don't use Mapc2mapc but I gather you can't get it to work with your tifs because your memory is "3mb". I'm not sure how you even get your browser to work with 3mb so I'll assume you just mean it's an old and slow computer maybe a PIII with 128 mb of ram...


Compressing by itself DOES NOT REDUCE Memory usage.It only reduces hdd space for the file. The computer must decompress and show you the full size and all colours.

But Colour and SIZE REDUCTION DOES save memory usage. ie bits, bytes and all that.

I'd reduce colours first and try it. 256 colours is a big reduction from 16million!!! but 64,32,16 colours are even more.16 colours often works fine for charts.

SIZE: a really big image might need reduction in size. Try 75%. Try 50%

I likethe NEWest version of irfanview myself .that said, irfanview seems to have a nasty habit of reporting 16million colours to the operating system even if there are 256 in fact ,so test by using the "info" button and for a reduced file size.

Or use xnview. These both come in portable versions...no install.

both have batch conversion utility and I've had em churning away with P!!! computers no problem


If they are not calibrated, you will have to do it, in a form acceptable to Mapc2mapc. BUT You can test to see if they are with GeoMetaData_Extractor.

TIP: if you need to use MapCal2, convert the tiffs to pngs
TIP:Open the file twice the first time you run GeoMetaData_Extractor! which also runs portably.
HappySeagull is offline   Reply With Quote
Old 15-10-2012, 12:37   #3
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Re: Compress large Tif-charts

[QUOTE=HappySeagull;1059473]oem, I'm assuming you want to convert these tiffs to kaps for O?

Yes, exactly..

For one of the original files gdalinfo says:

Driver: GTiff/GeoTIFF
Files: test.tif
Size is 20000, 12095
Coordinate System is:
PROJCS["unnamed",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["latitude_of_origin",56],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
Origin = (32596.499999997253000,4187195.443481133800000)
Pixel Size = (1.263844999999897,-1.263803224471360)
Metadata:
TIFFTAG_SOFTWARE=CARIS++
TIFFTAG_DATETIME=2012:06:12 10:04:35
TIFFTAG_XRESOLUTION=508
TIFFTAG_YRESOLUTION=508
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 32596.500, 4187195.443) ( 9d31'20.79"E, 55d44'9.29"N)
Lower Left ( 32596.500, 4171909.743) ( 9d31'20.79"E, 55d35'50.78"N)
Upper Right ( 57873.400, 4187195.443) ( 9d55'39.24"E, 55d44'9.29"N)
Lower Right ( 57873.400, 4171909.743) ( 9d55'39.24"E, 55d35'50.78"N)
Center ( 45234.950, 4179552.593) ( 9d43'30.01"E, 55d40'0.26"N)
Band 1 Block=20000x1 Type=Byte, ColorInterp=Red
Band 2 Block=20000x1 Type=Byte, ColorInterp=Green
Band 3 Block=20000x1 Type=Byte, ColorInterp=Blue


so it seems to be georeferenced. But that's not really my problem, I can easily calibrate again manually. You might be right that my pc is old, 3-4 years, and only 3 gb memory, but I have been using that PC for all my other charts.

This particular chart ('test.tif') I know can be reduced/compressed to less than 1 mb, because I already have that chart as a KAP-file, but an older version. The tif-file contains a new version, so of course I'd like to make that my new current version.

I thought that if I could reduce the size first, then I could calibrate and convert to .kap thereafter.

The Info button in IrfanView says:

(...)

Compression: LZW
Resolution 508 x 508 DPI
Original Size: 20000 x 12095 Pixels
Current Size: (as above)
Print size (from DPI): 100.0 x 60.5 cm
Original colours: 16,7 millions (24 bitsPerPixel)
Current colours: (as above)
Number of unique colours: 13
Disk size: 15.42 MB
Current memory size: 692.08 (725.700.040 bytes)
(...)


With 'gdal_translate -of png test.tif testpng.png' I can reduce the file to approx 3,5 MB, but I'm still running into problems (too litte memory) to calibrate and convert to .KAP.

I tried (with gdal_translate also) to use JPEG compression, but the result is not as good as PNG.

Would it be possible to reduce the colours (only 13 used), DPI or something else? So that my input file for calibration would be a lot smaller. And how do I do it?

Any good advice?
oem is offline   Reply With Quote
Old 15-10-2012, 15:05   #4
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Re: Compress large Tif-charts

Quote:
Originally Posted by oem View Post
Any good advice?
I made it too complicated, I think. The solution is straight forward. All I need is Irfanview. I thought I would need a deep technical knowledge on image-file formats.

I looked at the size at my old charts and found that they were 20-25% the size of the tif-charts. So with Irfanview I resized a few charts and saved as BMP. The file sizes as BMP ended up as 40-60 MB, - uncompressed (!). And 3 GB memory is enough.

Since my new charts all have a border with lat/lon printed it is a very easy task, with mapc2mapc, to calibrate 4 points and then to save as KAP-file. The file sizes for the KAP-files end up as 1-2 MB, which is very fine concerning speed, and they work very well in Ocpn. And with the printed lat/lon-border it's easy to verify my calibrations..

So now I have some wonderful charts, updated as per mid 2012. That is, I have a few hours of work before, but then I will have...

Good advice is still appreciated though...:-)

Wisdom is said to be the sum of all mistakes you make. Unfortunately I haven't made enough mistakes yet...:-)
oem is offline   Reply With Quote
Old 15-10-2012, 16:34   #5
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Compress large Tif-charts

3 GB? how can you "run out of memory" with that ? I thought you said 3mb. Garbage in, garbage out as every seagull knows...but it's still sort of disappointing that you can't knead the originals assuming the bmps would be 692mb full-sized.... I'd still prefer to trade the number of colours for a chart than the dimensions because I HATE seeing thick jaggy contour lines when I Pixel-Peep at a realife scale ...

quote:
(Disk size: 15.42 MB
Current memory size: 692.08 (725.700.040 bytes)


and maybe the OS is at fault. I really doubt if XP (for instance), is up to using that much ram and it makes no use of dual processors either, that I can notice....
HappySeagull is offline   Reply With Quote
Old 16-10-2012, 07:11   #6
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Re: Compress large Tif-charts

Quote:
Originally Posted by HappySeagull View Post
3 GB? how can you "run out of memory" with that ? I thought you said 3mb. Garbage in, garbage out as every seagull knows...but it's still sort of disappointing that you can't knead the originals assuming the bmps would be 692mb full-sized.... I'd still prefer to trade the number of colours for a chart than the dimensions because I HATE seeing thick jaggy contour lines when I Pixel-Peep at a realife scale ...

quote:
(Disk size: 15.42 MB
Current memory size: 692.08 (725.700.040 bytes)


and maybe the OS is at fault. I really doubt if XP (for instance), is up to using that much ram and it makes no use of dual processors either, that I can notice....
I did say 3mb, - sorry. k,m og g, - I keep mixing them up because it's not that long ago that e.g. a Digital Vax 11/750 did only have 1 mb memory. Sorry again.

Thanks for your help, I found my way through, which is a mix between colour and re-sizing and then calibration.
oem is offline   Reply With Quote
Reply

Tags
charts


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


Advertise Here


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


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.