[Kde-games-devel] Revised pixmap to svg script

Luciano Montanaro mikelima at gmail.com
Mon Apr 20 13:50:26 CEST 2009


On Mon, Apr 20, 2009 at 4:24 AM, Parker Coates <parker.coates at gmail.com> wrote:
> On Sun, Apr 19, 2009 at 6:49 PM, Luciano Montanaro wrote:
>> On domenica 19 aprile 2009, Luciano Montanaro wrote:
>>> I tend to agree with you, but there are people hanging on those decks.
>>> And on the other side, we miss an SVG deck with german cards for LtSkat.
>>> I'd like to address that last part if nobody else beats me. But It will
>>> take time...
>>> Maybe we could address that with a higher quality hybrid approach for KDE
>>> 4.3, anyway (that is, using higher quality pixmaps embedded in an SVG
>>> wrapper).
>>>
>>
>> Replying to myself, I just did some work to do that... although there are open
>> issues still.
>>
>> I did not package a deck for kdegames, but the svg file is almost there...
>>
>> I started from a public domain deck image from wikipedia.
>> The problem is that it only has cards for skat.
>>
>> Anyway, if anybody wants to have a look, the deck (composed of a png file,
>> huncards.png and the svg wrapper, huncards-test.svg) is here:
>>
>> http://www.cirulla.net/listing/kde_stuff/card-decks/
>>
>> together with the generator script, "generate-huncards.pl".
>>
>> At the moment the script is specific to generate a skat 32 card deck, with the
>> card measures hardcoded... but it could be used as a starting point for a
>> generic deck creation script.
>
> Hello Luciano,
>
> Sorry for not replying sooner. I've already converted 3 of the 5 PNG
> based scripts using the script you sent me. If you think I should
> stop, let me know.

I don't think so, I was just trying to answer your worries. The end
result would be similar, in the end; with embedded pixmaps, the svg
file would be larger than png files + svg wrapper, though compressing
it would likely be a net space gain (since each file wastes 2KB on
average due to disk block granularity).


>
> What advantages would a hybrid solution have? Both KDE card games
> support SVG decks, so I'm missing the advantage of keeping the cards
> around as individual PNGs as well.

The advantage would be that we could be sure there would not be
duplicate decks lying around.
It's not something I would worry much about, since the space is not
really that much, and  a fresh install would not suffer from it.

Then, there is the issue that the embedded image is encoded in base64,
that is, six bytes in the png file become roughly 8 bytes in the svg
file. Compressing the resulting file would likely eliminate most of
the waste, but there would be an additional decoding step.

On the other hand, each card image wastes 2K on average, and opening
many files is an expensive operation on its own, so embedding the
images would not make loading the theme slower.

>
> As for hanging on to the old cards, I think the ideal solution would
> be adding support for GHNS to the deck selector. If that happened, we
> could crop down the number of decks shipped with the KDEGames package,
> while simultaneously increasing the number of decks available overall.
>

I agree with this, I already have a few deck to contribute when that
will be an option.

What about the skat deck? There is an issue at the moment that we have
no way to specify a deck has not the full complement of cards. Would
be beneficial to add some flag to the .desktop file and an API for the
card selector to ask for a particular subset of cards?

I can think of a few kinds of decks we could support; at the moment we
need only two:

International 52 cards
Skat 32 cards

But we could have games with different card series:

International with Jolly Jockers
Tarot
Italian 40 cards
Spanish 26 cards (I think)


Luciano
-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams


More information about the kde-games-devel mailing list