Yes, your reference from css-tricks is exactly what I use in static applications. Webp is pretty incredible for compressed image formats. I have some other examples here. 1200% improvement over png.
Regarding the SEO it's not a direct penalty but a notice from SEM Rush on how these links delute other, more relative links. They are noting it may be a sign of poor archtecture but I'm more concerned of taking focus away from intended internal back links. The nofollow attribute helps but then excludes those image from being cataloged. My goal is to come up with a better slideshow where the images are based on a php array so not direct anchor links.
Thank you for the example file.
Does picturefill.js do something special? In the attached file lacking picturefill it seems browsers are happy to accept the @media attribute without the attached js file. The attached file will show either the jpg or webp file based on the viewport size which is useful as well as use the picture tag to enable browsers like safari to degrade to the png version.
Oh I didn’t mean to have that in there – left it in from some testing. It adds some nice features for responsive images based on media queries. You could pair this markup with Hype’s responsive layouts to speed up image loading for smaller layouts:
Current support is looking pretty strong. Any plans for this capability to be added to Hype, so they can be manipulated the same as any png or jpg? I'm happy we can use them already, they're just a bit more cumbersome to deal with in comparison.
That is true, you probably need to have everything in the resources' folder for these. Here is another approach that allows you to add a WebP version to your resources folder, and it switches the file dynamically if supported. You still need to create the WebP files, though.
Well, yes and no. The PNG file will never be downloaded if WebP is supported. If you mean that the ad network might decline your ad because of weight of the ZIP-file itself, that's another discussion to be had. You could always just ditch the support_format_webp() check and function and force the WebP onto the end user, but that would inherit the risk of using a relative new format on an older browser. This choice cannot be avoided even if Hype would support it native.
My thoughts are to use WebP images only (with no fallback) within the display ads, served locally from the packaged ad. I don't plan on using this in every ad produced, but I'm thinking of trying this out for image-heavy ads that would otherwise be impossible to fit within ad server specs. Safari is the only browser support that gives me pause.
If I wanted to use fallback images for when WebP isn't supported, I feel like ad servers would be more accepting of CDN delivery rather than packaging all images, knowing all wouldn't be served. I've run into instances where they count static backup images as part of the total K-weight, which makes zero sense.
I know that support of these is no different whether Hype has native support or not. My desire is for WebP images within Hype to have the same functionality as other images.
Huh. I'm on Hype 4.1.5 and while I can drag a WebP into the resources panel, I can't get them onto the stage. Trying another way and using Insert > Image from the menu, WebP files are greyed out...
How'd you do that?
Pretty sure Hype is using an allowed type by extension name rather than encoding as I just changed a webp extension to .jpeg and it let it in but could not parse it correctly.
Did the same with a jpeg-> webp and it was blocked.
I dragged the WebP image directly into the stage. Seems like it is not checking types in that case? I am also on 4.1.5 (728) Professional Edition. It even works when I drag WebP into Resources. I need to turn off image optimization as it would convert to jpg on export.
Since Hype uses Safari's rendering engine under the hood and macOS 11 declares this as a valid image format, Hype will import and display this properly* as well. Due to this, even Hype 1.0.0 supports webp on the right OS .
(* It seems it doesn't put it in a resource library @1x/@2x grouping, so we'll need to fix that bit)