-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR - internal GetPalette \nERROR - imgkap ((null)) return 2 #4
Comments
Klaus... Pavel |
Hi Pavel, Thanks for the quick response! I'll send it to you by Wetransfer (you'll get a message with a link to the file). Klaus |
Yes, of course it does - the KAP contains a TIFF with palette so we must shrink it. But exactly for this reason it is much wiser to do it before depending on the input image. I did a small test with your file:
Every single one of them is much smaller than your file and perfectly usable with imgkap... If you ask me what to do, looking at the sample picture, I would definitely make the tileserver generate it with much reduced palette (Seems that 32 colors should be more than enough) to get the best possible resulting KAP. |
The conversions do make them smaller but..... will they still use the same colors for the same "object-types"? Otherwise you will get (slight) transitions in color between two aligning maps. |
You can use a fixed palette in your conversions. But note that you would have the same problem even now if it was to worry about - during the KAP creation your 24bit palette is shrunk to less than 8bit inside imgkap even though you don't directly see it, so still better to have the process under control and do it yourself, IMHO... |
grin... I will bring down the number of used colors in the tileserver-stylesheet and re-render. Hopefully it will solve the problem. |
Hi Pavel, Regards, |
Hi, I added a call of library function FreeImage_ColorQuantizeEx() before the call of function writeimgkap() to reduce the number of colors to 127 with the library function. This workaround solved my conversion problem without additional call of the imagemagick "convert" application. Best Regards Steffen |
Steffen... |
Looked at the PR, I get the point. I have checked with the above attached image and |
Hi Pavel,
I'll try to compile the updated code in the near future to test.
It would save me quite some time in generating the .kap's ;-)
Regards,
Klaus
Op 29-8-2018 om 17:30 schreef Pavel Kalian:
…
Looked at the PR, I get the point. I have checked with the above
attached image and |FreeImage_ColorQuantizeEx| returns NULL from it.
The
(awful)|FreeImage_ColorQuantizeEx(FreeImage_ConvertTo24Bits(tmp_bitmap),
FIQ_NNQUANT, 127, 0, NULL);| hack seems to resolve it. Can you please
check if it would be usable also with your problematic bitmaps?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AUDIFEGB-m6wMoF1Yt3_di8h-EYoKFxZks5uVrOLgaJpZM4Jp1P_>.
--
____________________________________________________________
IT-Works
tel. +31 (0)6 248 11 798
KvK-nummer: 01078599
[email protected] <mailto:[email protected]>
www.it-works.frl <http://www.it-works.nl>
|
Hi Pavel, I'm no C-wonder I'm afraid.... I'm building a new "tile to .kap-server" at the moment and it would be nice to implement the right changes in imgkap and put them to use :-) Regards, |
I will push a slightly changed logic outlined by #6 in a couple of days, just being way too busy right now. |
Hi Pavel, Best Regards Steffen |
I did. Unfortunately it has other issues. I did not have time to fix those yet. |
I generated tiles with a tileserver to 10240x10240 (16 million colordepth) pixel png's and want to convert the resulting png to .kap-files for usage in OpenCPN.
Of the 224 large png's, that cover the Netherlands, two of them make imgkap crash with the above ERROR-message.
I tried "fixing" the png's by converting them to bmp and back but the resulting files still crash so I guess it must be something in imgkap that overflowes because of the large number of colors in the png (28794 in one of the png's).
I can deliver the png for testing if you want?! You can mail me at [email protected]
The text was updated successfully, but these errors were encountered: