Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 29-09-2015, 17:12   #1
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Rastersymbols: Reduce to 1024x1024

Task oriented thread:
Reduce rastersymbols-xxxx.png to "fit" in 1024x1024

Sean Depagnier:
Quote:
the raspberry pi graphics hardware supports textures to 2048x2048, however only rectangular (non power of 2) to 1024x1024 or so roughly. So the chart symbols which is 1500x1200 cannot fit and I must allocate 2048x2048 which uses 16mb of video memory instead of the usual 6mb.

My feature request is, could someone rearrange the files in data/s57data like rastersymbols-day.png to "fit" in 1024x1024.? I think it can as there is a lot of space. And a bunch of the icons can be removed because they aren't even used. The chartsymbols.xml would have to be updated as well. This could probably be done with a script which re-packs everything. It will benefit all users with reduced use of graphics memory, faster loading time, and less disk space so also smaller download for opencpn.
Task:
Quote:
could someone rearrange the files in data/s57data like rastersymbols-day.png to "fit" in 1024x1024.? I think it can as there is a lot of space. And a bunch of the icons can be removed because they aren't even used. The chartsymbols.xml would have to be updated as well.
C:\.. \GitHub\OpenCPN\data\s57data
rastersymbols-dark.png
rastersymbols-day.png
rastersymbols-dusk.png
These are all 1500x1200 pixels
Sean wants them to be 1024x1024

and to change the xml file chartsymbols.xml accordingly.

Is there some way I can get a handle on which symbols are not used?
Is there any particular criteria for packing?
Is 2 pixels apart adequate?
Must they be in a certain order (because some of them are larger than the others)

Looks like we can get to 1024 vertical by just cutting off the bottom and moving a few symbols. Compacting horizontally will require moving the last 1/3 of a row into intermediate open space vertically.

I assume the three rastersymbol-day, dusk and dark files should all be arranged identically so that the xml will be identical. This may require editing all three at the same time.

Is there a way to just edit ..day and then create the dusk and dark with a change in colors by color remapping or something?
12.*Palettes
-- The second type, indexed palettes, form the colormaps of indexed images. Each indexed image has its own private indexed palette, defining the set of colors available in the image: the maximum number of colors allowed in an indexed palette is 256. These palettes are called “indexed” because each color is associated with an index number.
-- When you convert an image into indexed mode, a major part of the process is the creation of an indexed palette for the image. How this happens is described in detail in Section 6.6, “Indexed mode”.

So we just have to reduce to 1024x1024, the "rastersymbol-day.png" file and then apply the related indexed palette for the other two dusk and dark.
rgleason is offline   Reply With Quote
Old 29-09-2015, 17:14   #2
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Rastersymbols: Reduce to 1024x1024

Any suggestions, methodology or information regarding which symbols in rastersymbols-day.png are NOT used would be very helpful.
rgleason is offline   Reply With Quote
Old 29-09-2015, 18:23   #3
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Rastersymbols: Reduce to 1024x1024

Chartsymbols.xml

<chartsymbols>
<color-tables>
<color-table name="DAY_BRIGHT">
<graphics-file name="rastersymbols-day.png" />
<color name="NODTA" r="163" g="180" b="183"/>
...
<color-table name="DAY_BLACKBACK">
<graphics-file name="rastersymbols-day.png" />
<color name="NODTA" r="125" g="137" b="140"/>
...
<color-table name="DAY_WHITEBACK">
<graphics-file name="rastersymbols-day.png" />
<color name="NODTA" r="139" g="153" b="155"/>
...
<color-table name="DUSK">
<graphics-file name="rastersymbols-dusk.png" />
<color name="NODTA" r="41" g="46" b="46"/>
...
<color-table name="NIGHT">
<graphics-file name="rastersymbols-dark.png" />
<color name="NODTA" r="7" g="7" b="7"/>
...

What do
r g and b
stand for? RGB ? Looks like it.

So there is no colortable needed, I guess.

If I am correct about the RGB above, where are the two location x,y stored?
rgleason is offline   Reply With Quote
Old 29-09-2015, 18:27   #4
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Rastersymbols: Reduce to 1024x1024

In looking this over, it is too detailed to accomplish without some rules and some tools that link each of the files together and allow someone to move the individual symbols and reinsert them while all the positional setting change.

There must have been some tools like this used to create the files originally.
We need them now.

Otherwise there is a strong likelihood that whatever is done with break the symbol system we have now.
rgleason is offline   Reply With Quote
Old 30-09-2015, 00:34   #5
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Rastersymbols: Reduce to 1024x1024

Yes, well this is why I suggested writing a script to repack them as it could run on each file as well, then just generate the xml file.
seandepagnier is offline   Reply With Quote
Old 30-09-2015, 08:12   #6
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Rastersymbols: Reduce to 1024x1024

After looking at it, I agree with you, Sean.
Still, where are the x,y image locations found in the xml file?
I found rgb values, but not x,y!
rgleason is offline   Reply With Quote
Reply


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
Reduce Charging Time R_C Electrical: Batteries, Generators & Solar 35 30-11-2009 15:42
reduce size of ice box gonesail Plumbing Systems and Fixtures 5 06-02-2008 13:06
Best ways to reduce cat's asking prices arizolac Multihull Sailboats 7 29-07-2006 21:10
moving traveler to reduce heel Doghouse General Sailing Forum 5 29-05-2006 07:00

Advertise Here


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


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.