Post has a photo
Using WebP coded images inside SVG containers works. I haven’t found any automatic way to do it, but it is easy enough manually and results in very efficiently coded images that work well on the internets. The manual process is to Base64 encode the WebP image and then open the .svg file in a text editor and replace the
(“…” means the appropriate data, obviously).
Back in about 2010 Google released the spec for WebP, an image compression format that provides a roughly 2-4x coding efficiency over the venerable JPEG (vintage 1974), derived from the VP8 CODEC they bought from ON2. VP8 is a contemporary of and technical equivalent to H.264 and was developed during a rush of innovation to replace the aging MPEG-II standard that included Theora and Dirac. Both VP8 and H.264 CODECs are encumbered by patents, but Google granted an irrevocable license to all patents, making it “open,” while H.264s patents compel licensing from MPEG-LA. One would think this would tend to make VP8 (and the WEBM container) a global standard, but Apple refused to give Google the win and there’s still no native support in Apple products.
A small aside on video and still coding techniques.
All modern “lossy” (throwing some data away like .mp3, as opposed to “lossless” meaning the original can be reconstructed exactly, as in .flac) CODECs are founded on either Discrete Cosine Transform (DCT) or Wavelet (DWT) encoding of “blocks” of image data. There are far more detailed write ups online that explain the process in detail, but the basic concept is to divide an image into small tiles of data then apply a mathematical function that converts that data into a form which sorts the information from least human-perceptible to most human-perceptible and sets some threshold for throwing away the least important data while leaving the bits that are most important to human perception.
Wavelets are promising, but never really took off, as in JPEG2000 and Dirac (which was developed by the BBC). It is a fairly safe bet that any video or still image you see is DCT coded thanks to Nasir Ahmed, T. Natarajan and K. R. Rao. The differences between 1993’s MPEG-1 and 2013’s H.265 are largely around how the data that is perceptually important is encoded in each still (intra-frame coding) and some very important innovations in inter-frame coding that aren’t relevant to still images.
It is the application of these clever intra-frame perceptual data compression techniques that is most relevant to the coding efficiency difference between JPEG and WebP.
Back to the good stuff…
Way back in 2010 Google experimented with the VP8 intra-coding techniques to develop WebP, a still image CODEC that had to have two core features:
- better coding efficiency than JPEG,
- ability to handle transparency like .png or .tiff.
This could be the one standard image coding technique to rule them all – from icons to gigapixel images, all the necessary features and many times better coding efficiency than the rest. Who wouldn’t love that?
Of course it was Apple. Can’t let Google have the win. But, finally, with Safari 14 (June 22, 2020 – a decade late!) iOS users can finally see WebP images and websites don’t need crazy auto-detect 1974 tech substitution tricks. Good job Apple!
It may not be a coincidence that Apple has just released their own still image format based on the intra-frame coding magic of H.265, .heif and maybe they thought it might be a good idea to suddenly pretend to be an open player rather than a walled-garden-screw-you lest iOS insta-users wall themselves off from the 90% of the world that isn’t willing to pay double to pose with a fashionable icon in their hands. Not surprisingly, .heic, based on H.265 developments is meaningfully more efficient than WebP based on VP8/H.264 era techniques, but as it took WebP 10 years to become a usable web standard, I wouldn’t count on .heic having universal support soon. I expect Google is hard at work on a VP9-based version of WebP right now. Technology is fast, marketing is slow. Oh well. In the mean time….
SVG support in browsers is a much older thing – Apple embraced it early (SVG was not developed by Google so….) and basically everything but IE has full support (IE… the tool you use to download a real browser). So if we have SVG and WebP, why not both together?
Oddly I can’t find support for this in any of the tools I use, but as noted at the open, it is pretty easy. The workflow I use is to:
- generate a graphic in GIMP or Photoshop or whatever and save as .png or .jpg as appropriate to the image content with little compression (high image quality)
- Combine that with graphics in Inkscape.
- If the graphics include type, convert the type to SVG paths to avoid font availability problems or having to download a font file before rendering the text or having it render randomly.
- Save the file (as .svg, the native format of Inkscape)
- Convert the image file to WebP with a reasonable tool like Nomacs or Ifranview.
- Base64 encode the image file, either with base64
# base64 infile.webp > outfile.webp.b64or with this convenient site
- If you use the command line option the prefix to the data is “
- Replace the … on the appropriate
xlink:href="...."with the new data using a text editor like Atom.
- Drop the file on a browser page to see if it works.
The picture is 101.9kB and tolerates zoom quite well. (give it a try, click and zoom on the image).
Some of the coding tricks in H.265 have been incorporated into MPEG-H coding, an ISO standard introduced in 2017, which yields a roughly 2:1 coding efficiency gain over the venerable JPEG, which was introduced in 1992. Remember that? I do; I’m old. I remember having a hardware NUBUS JPEG decoder card. One of the reasons JPEG has lasted so long is that images have become a small storage burden (compared to 4k video, say) and that changing format standards is extremely annoying to everyone.
Apple has elected to make every rational person’s life difficult and put a little barbed wire around their high-fashion walled garden and do something a little special with their brand of a HEVC (h.265) profile for images. Now normally seeing iOS user’s insta images of how fashionable they are isn’t really worth the effort, but now and then a useful correspondent joins the cult and forks over a ton of money to show off a logo and starts sending you stuff in their special proprietary format. Annoying, but fixable.
$ sudo add-apt-repository ppa:jakar/qt-heif $ sudo apt update $ sudo apt install qt-heif-image-plugin
When I was a young child, my dad bought a brand new 1976 GMC Suburban. Yellow. No extras at all – no head liner, plastic seats, manual everything, 305 V8.
It became my car in high school, survived that. Came out to California with me; ended up in the service of SRL, survived that too.
Eventually, it escaped.
I noticed that my avocado tree was developing brown spots on the leaves, which were almost certainly the result of Persea mites.
So I looked up some possible cures, and it seemed like introducing a predator would be the best option and the least hassle. I’d had good luck with introduced ladybugs a few years back, which formed a stable population that survived for many years after introduction. For this pest, green lacewings are recommended. I found a nearby insectary that could provide larvae on cards and they shipped them overnight.
The little guys look cute just waiting to hatch…
I hung he cards on the leaves of the tree after incubating them overnight in a warm room, and they should hatch sometime in the next day or two, as long as the ants don’t find them first…
Update 8 Sept 2016:
The green lacewings seem to have eaten all the mites. It has been 9 months and there aren’t any signs of damage to this spring’s leaves. Yay!
The new leaves that grew seem to be developing without any bites at all. The old leaves that were too damaged have fallen off, but the surviving older leaves still show the scars of the mites. Green lacewings seem to have done the trick.
@United has new coach trays that are coated with a material that has an amazing coefficient of friction. They are not sticky at all—there’s no adhesion effect—it is all friction. Even low surface energy plastics don’t slide on it at all.
The approximately 75-80° angle in the picture is the point at which the cup topples over itself. It isn’t adhered to the surface and it doesn’t appear to slide at all before toppling.
This would be the perfect coating for a smart phone pad in a car.
A couple of years back a random sprout appeared in the yard. It looked like a volunteer avocado and grew bizarrely fast. After a few years, it is about 15′ tall and this year it fruited for the first time. It really is an avocado tree.
My kitchen has had halogen lighting for 20 years, from back when it was a slightly more efficient choice than incandescent lighting and had a pleasing, cooler (bluer, meaning the filament runs hotter) color temperature.
Progress has moved on and while fluorescent lights still have a lead in maximum luminous efficacy (lm/w), for example the GE Ecolux Watt-Miser puts out 111 lm/W, they’re less versatile than LEDs and installation is a hassle while low voltage LEDs are easy to install and look cool.
The goal of this project was to add dimmable, pleasing light to the kitchen that I found aesthetically interesting. I wanted a decent color rendering index (CRI), ease of installation, and at reasonable cost. I’ve always liked the look of cable lighting and the flexibility of the individual, adjustable luminaires.
I couldn’t find much information on how variable output LEDs work and what can be used to drive them. I have a pretty good collection of high quality power supplies, which I wanted to take advantage of, but wasn’t sure if I’d be able to effectively dim the bulbs from the documentation I found. So I did some tests.
I bought a few different 12V, Dimmable LEDs and set up a test configuration to verify operation and output with variable voltage and variable current. The one bit of data I had was that using standard commercial controllers, the lowest output is typically stated to be around 70% of maximum output: that is the dimming range is pretty limited with standard (PWM/Transformer) controllers. The results I found were much more encouraging, but revealed some quirks.
I used a laboratory-grade HP power supply with voltage and current control to drive the LEDs, decent multimeters to measure voltage and current, and an inexpensive luminance meter to measure LED output.
I measured 3 different LEDs I selected based on price and expected compatibility with the aesthetics of the project and because they looked like they’d have different internal drivers and covered a range of rated wattage.
These bulbs have internal LED controllers that do some sort of current regulation for the diodes that results in a weird voltage/current/output response. Each bulb has a different turn-on voltage, then responds fairly predictably to increasing input voltage with increasing output, reaches the controller stabilizing voltage and runs very inefficiently until voltage gets over the rated voltage and then becomes increasingly efficient until, presumably, at some point the controller burns out. I find that the bulbs all run more efficiently at 14V than at the rated 12V.
As a side note, to perform the data analysis, I used the excellent
xongrid plugin for excel to perform Kriging interpolation (AKA Gaussian process regression) to fit the data sets to the graphing function’s capabilities. The graphs are generated with WP-Charts and the table with TablePress.
Watts v. Volts
This chart shows the wattage consumed by each of the three LEDs as a function of input voltage, clearly demonstrating both that the power consumption function is non-linear and that power consumption in watts improves when driven over the rated 12V. Watts are calculated as the product of the measured Volts * Amps. Because of the current inversion that happens as the controllers come fully on-line, these LEDs can’t be properly controlled near full brightness with a current-controlled power supply, though it works well to provide continuous and fairly linear dimming at low outputs, once the voltage/current function changes slope, the current limiting controller in the power supply freaks out.
4W LED 5W LED 7.5W LED
Lux v. Volts
This chart shows the lux output by each of the three LEDs as a function of input voltage, revealing the effect of the internal LED driver coming on line and regulating output, which complicates controlling brightness but protects the LEDs. The 5W LEDs have a fairly gentle response slope and start a very low voltage (2V) so are a good choice for a linear power supply. The 4W LEDs don’t begin to light up until just over 6V, and so are a good match for low-cost switch mode supplies that don’t go to zero.
4W LED 5W LED 7.5W LED
Lux/W v. Volts
This chart shows the luminous efficiency (Lux/Watt, Lumen measurement is quite complicated) by each of the three LEDs as a function of input voltage, showing that overdriving the LEDs past the rated 12V can significantly improve efficiency. There’s some risk it will overheat the controller at some point and result in failure. I’ll update this post if my system starts to fry LEDs, but my guess is that 14V, which cuts the power load by 20% over 12V operation with the 7.5W lamps I selected, will not significantly impact operational lifetime.
4W LED 5W LED 7.5W LED
Total System Efficiency
The emitter efficiency is relatively objective, but the total system efficiency includes the power supply. I used a Daiwa SS-330W switching power supply I happened to have in stock to drive the system, which cost less than a dimmable transformer and matching controller, and should be significantly higher quality. The Daiwa doesn’t seem to be easily available any more, but something like this would work well for up to 5A total load and something like this would handle as many as 40 7.5W LEDs on a single control, though the minimum 9V output has to be matched to LEDs to get satisfactory dimming. It is important not to oversize the power supply too much as switch mode supplies are only really efficient as you get close to their rated output. An oversized switchmode power supply can be extremely inefficient.
With the Daiwa, driving 13 7.5W LEDs, I measured 8.46A at 11.94V output or 101 Watts to brightly illuminate the entire kitchen, and providing far more light than 400W of total halogen lights. I measured the input into the power supply at 0.940A at 121.3V or 114 Watts. That means the power supply is 88.6% efficient at 12V, which is more or less as expected for a variable output supply.
Increasing the output voltage to 14.63 Volts lowered the output current to 5.35A or 78 Watts without lowering the brightness at the installation; I measured at 168 lux at both 12.0V at 14.6V. The input current at 14.63V dropped to 0.755A or 91.6 Watts, meaning the power supply is slightly less efficient at lower output currents (as is usually the case).
- Overdriving the 12V rated LEDs to 14.63V improves plug efficiency by 20%.
At the low end, the SS-330W’s minimum output is 4.88V, which yields 12 lux at the counter or a 14x dimming ratio to 7% of maximum illumination, a far better range than is reported for standard dimmer/transformer combinations.
- 7.5W LED modules from JackyLED
- Daiwa power supply (alternate version)
- 16 gauge speaker cable
- MR-16 cable lamp mounts
- Digital light meter
(MS Excel file, you will need the
xongrid plugin to update the data as rendered in the graphs)
I was feeling a little left out, reading posts by people digging out of snow storms and here I am in Basra where it gets down to 10C at night sometimes and usually hits the mid 20’s during the day. Rough. But the weather here came through with our own sort of snow storm.
Starting to look like a brown-out!
Obligatory shot of the yard furniture getting covered.
Kitty’s head is starting to show some accumulation.
With all this blowing through you can barely see a few hundred meters!
It’s really starting to accumulate. Where’s the snow blower?
It takes some special cleaning after playing out in it.