kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #41841
Re: How to make single-plane .cpp from .png?
-
To:
Nick Østergaard <oe.nick@xxxxxxxxx>
-
From:
Johannes Sprigode <jos@xxxxxxxxxxx>
-
Date:
Thu, 8 Aug 2019 12:17:38 +1200
-
Autocrypt:
addr=jos@xxxxxxxxxxx; keydata= xsBNBFpDLzIBCACqxSP3Ctfpu8McGO6C8jlhZJdWHA/QpEdvrczSR+ImnpaW/lx7kGXgHvM+ 2xK/1mXyDw8j9/0u0rVFfgENZYmtswext0mr7i9a4YZnI2TURlEKkUBLfrh+ilTxF03c4Jb3 1PCllCPfxdeOqeHR5qMq4/WJFERR8Jkhqho333nQ9ekSNdiKv+zerxYKghX9lp9BRDL9s2/2 9OFo26ZimUI5XRl3CMvHn5CmCFX7cqXqAJRxVyOGeQGL04+c/o0FTOBpK2170suBtHPddXkF sTGYigjyEpG7UB/7O9P16tW/z1HNOzk0Gc09lJ3+LhnxDhWySAsH1p77WREaXkeWKHXXABEB AAHNI0pvaGFubmVzIFNwcmlnb2RlIDxqb3NAdmZlZHRlYy5jb20+wsCUBBMBCAA+AhsDBQsJ CAcCBhUICQoLAgQWAgMBAh4BAheAFiEE60l7KEo1nMQG9OvQelodVk+2oksFAlv8m3sFCQOa n8kACgkQelodVk+2okvYGQf+Kzs0Ezv/f6NRyxt+1NFjQqS8XKnF/Y9Q+g3MLwRYFT1Gnsj0 2eZUp7WFiuRfFrLdPA4GBkJfp7+7KuQqMChiYYspR3gwde7gyeJPSfhUW4eSkOb8u2nHH7pa /rEhNLnboXfMswC/iC/aLDV1OgyQaitGaP3bNcPWvK+xwMgTli6eD3r4UvA6+5aaghs66bAt a1WSLESdzau0RsGNdOBTLZrqwvmlOsfHOz7aWVbXUa2lBSDY/pE3Bq/x9aJZdfn2iMTgieU+ USJ/v5slDaifQr2CxLwYNaN0PGoQYS8B7JRHLdz421hdtrolS4NJtnbofacAziAtdajsCPuZ LVtZTc7ATQRaQy8yAQgAx3VWcy97OGM9UWlLLmqpeHH2NfGLDeMeAp43sK3PBOaQmK0PxBSC CJoVc9jbQCtdLm0PJPVjAK9Wrwz2tDCHgaq72dekOB0Ksfp081imazWCWZUzjXwFrcz4oXN5 zUrnxMdS1hrpckvMEEUBEJTXaUnce/WjMZoyV48QEVnJjC2uAqgwrf9UdCu8yZTrAW/EGgRK E0Wncz7htoBygeQMeCq1aGtMCAxEXlSUH9CNyvRJuFF/2QxOTAIFO2sq5gvnWZtr8rpyceL8 gvxvozKVEAuJPuEViabXjdQv6LSWX2TiKEq1Sgnq7tgNS5cbAKWI1HAAfyFeVLmBa1z/qgSW LQARAQABwsB8BBgBCAAmAhsMFiEE60l7KEo1nMQG9OvQelodVk+2oksFAlv8m3sFCQOan8kA CgkQelodVk+2okuTogf+LV8I9jKeiAgSs+/ecqjQ+tl6c4nPQAWSZrEGa66jkGxjg6avnTGC qbx0jS6ZGQ1DFGcjQ/ckW4VqRcZM2E3Xcwi4FfxrLpJTVr7yT5cv76ELBq7dM3nVcLnoy2Pj 0sUxP6AeT3IJs4fToA73PjcW8Coc2H4c3txVIuDbfBhi9EHogbTgCs7Fi+3SBhCkPim485yE J8Bg1Sl3C9+4mi2IIUchKJkitQFyHzT7RqPzSjs6HJtK3uLGQWHOvoUNdQ7zJHa/074VYgoB I1uPqXAhbRXLZCbq3x2fljfMls6vlpsCcbJ3LdpcaLBzxJwtg+863EK+KlMWogk21NdAi1vC oQ==
-
Cc:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CAOuK9LgaCfVBPF2c-38WKbRYGLxJcs_U1pMDEpC1TZVkAzTUBg@mail.gmail.com>
-
Openpgp:
preference=signencrypt
-
Organization:
vfed technologies
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
Thanks Nick, that made the resulting cpp files even smaller thanks to
pngcrush!
On 6/08/19 9:15 PM, Nick Østergaard wrote:
> Maybe I am off here, butnis there any reason why you can just enable
> the MAINTAIN_PNGS option to make it convert the svg to cpp?
>
> tir. 6. aug. 2019 06.01 skrev Johannes Sprigode <jos@xxxxxxxxxxx
> <mailto:jos@xxxxxxxxxxx>>:
>
> If I may chip in.
>
> The new symbols (16x16) I created for the horizontal text are done in
> inkscape and exported as png.
>
> Post processed in gimp to an 8-bit grey scale with alpha which reduced
> them from ~300 to ~170 something bytes.
>
> They still appear to have the same quality as you have seen. Settings
> attached.
>
> The same should be doable for those cursors, or anything alike.
>
> Cheers
>
> Johannes
>
> On 6/08/19 9:51 AM, Jeff Young wrote:
> > If you open the PNG in Gimp and then export as XBM it works.
> (Note that while wxBitmap’s constructor purports to support sizes,
> if you pass anything under 32x32 you’ll get garbage.)
> >
> > However, the cursors aren’t greyscale (they’re true
> black-and-white), so the whole SVG source idea produces some
> pretty ugly cursors. I think we’ll have to specify them as bitmaps.
> >
> >> On 5 Aug 2019, at 15:25, Jeff Young <jeff@xxxxxxxxx
> <mailto:jeff@xxxxxxxxx>> wrote:
> >>
> >> I also tried online converters for PNG -> XBM and directly from
> the source (SVG -> XBM), but they all give me black images….
> >>
> >>
> >>> On 5 Aug 2019, at 15:15, Jeff Young <jeff@xxxxxxxxx
> <mailto:jeff@xxxxxxxxx>> wrote:
> >>>
> >>> I found doc on the colour modes; 0 is monochrome without
> alpha, 2 is RGB, 4 is monochrome with alpha and 6 is RGBA.
> >>>
> >>> So -c 0 should be correct.
> >>>
> >>> But it appears wxBitmap is expecting XBM data rather than PNG
> data. Hm…..
> >>>
> >>>
> >>>> On 5 Aug 2019, at 14:46, Jeff Young <jeff@xxxxxxxxx
> <mailto:jeff@xxxxxxxxx>> wrote:
> >>>>
> >>>> pngcrush -c 0 makes a single-plane char array, but it appears
> to be in a different order or something (the array is the right
> size, but produces a garbage cursor).
> >>>>
> >>>> Anyone know what the other colour modes are? (0, 2, 4, 6)
> >>>>
> >>>>> On 5 Aug 2019, at 13:22, Jeff Young <jeff@xxxxxxxxx
> <mailto:jeff@xxxxxxxxx>> wrote:
> >>>>>
> >>>>> Our PNG2cpp.cmake script makes a 3 or 4 plane (ie: colour)
> char array.
> >>>>>
> >>>>> wxWidgets’ wxBitmap() constructor needs a single plane char
> array. John Beard created a couple for the SPICE cursors, but I’m
> not sure how he did it.
> >>>>>
> >>>>> Thanks,
> >>>>> Jeff.
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> Mailing list: https://launchpad.net/~kicad-developers
> >>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >>>>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>>>> More help : https://help.launchpad.net/ListHelp
> >>>>
> >>>> _______________________________________________
> >>>> Mailing list: https://launchpad.net/~kicad-developers
> >>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >>>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>>> More help : https://help.launchpad.net/ListHelp
> >>>
> >>> _______________________________________________
> >>> Mailing list: https://launchpad.net/~kicad-developers
> >>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>> More help : https://help.launchpad.net/ListHelp
> >>
> >> _______________________________________________
> >> Mailing list: https://launchpad.net/~kicad-developers
> >> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >> Unsubscribe : https://launchpad.net/~kicad-developers
> >> More help : https://help.launchpad.net/ListHelp
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help : https://help.launchpad.net/ListHelp
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Attachment:
signature.asc
Description: OpenPGP digital signature
References