<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.2">Jekyll</generator><link href="https://mostlypixels.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mostlypixels.com/" rel="alternate" type="text/html" /><updated>2025-04-18T17:50:43+02:00</updated><id>https://mostlypixels.com/feed.xml</id><title type="html">Mostly Pixels</title><subtitle>A small photography and pixel art website</subtitle><entry><title type="html">More birds</title><link href="https://mostlypixels.com/2025/03/12/more-birding.html" rel="alternate" type="text/html" title="More birds" /><published>2025-03-12T00:00:00+01:00</published><updated>2025-03-12T00:00:00+01:00</updated><id>https://mostlypixels.com/2025/03/12/more-birding</id><content type="html" xml:base="https://mostlypixels.com/2025/03/12/more-birding.html"><![CDATA[<p>It’s not yet insect season (although they’re coming back!), so I’m making efforts to practice photography anyway, despite how heavy my bird photography gear is.</p>

<p>My trembling noodle arms are not made to lift a 150-600mm lens.</p>

<p>Anyway, I try to have it with me more, including in my passenger seat when I drive around, and it paid off.</p>

<h2 id="i-found-more-kestrels">I found more kestrels!</h2>

<p>Two of them seem to have settled in a church, a ten minutes drive away from my place, so I will now head there regularly, hoping to see them again.</p>

<p>Here’s the female.</p>

<p><img alt="Female common kestrel with her beak open, looking out small stone window" class="img-smooth" src="/assets/posts/more-birds/shouting-kestrel.webp" /></p>

<h2 id="i-tried-to-find-a-heron">I tried to find a heron</h2>

<p>I did not find a heron.</p>

<p>I tried all the ponds and lakes I know they frequent, and went to a lock where I know they nested a few years ago, but no dice.
I did get some nice pictures of cormorants, though! They have beautiful eyes.</p>

<div class="row">
    <div class="col-12 col-6-md">
        <img alt="Great cormorant" class="img-smooth" src="/assets/posts/more-birds/cormorant.webp" />
    </div>
    <div class="col-12 col-6-md">
        <img alt="Great cormorant closeup" class="img-smooth" src="/assets/posts/more-birds/cormorant-closeup.webp" />
    </div>
</div>

<h2 id="an-egret-found-me">An egret found me</h2>

<p>It swooped down over a town street when I least expected it (mainly because I did not expect an egret in <em>town</em>, ever), and landed on a house’s chimney.</p>

<p>I needed a moment to process the white shape was not an “abnormally large seagull”, then I swerved off the road and ejected myself from my car in my hurry to take pictures.</p>

<p>The egret was kind enough to pose for me until I was done. I did <em>not</em> get a front view of its face, which is a shame because everyone should see an egret/heron from the front.</p>

<p>Incidentally, the egret found me while I was looking for the <em>kestrels</em>, not the herons.</p>

<h3 id="my-first-pic-of-a-great-egret-ever">My first pic of a great egret, ever:</h3>

<div class="row">
    <div class="col-12 col-6-md">
        <img alt="Great egret on a chimney" class="img-smooth" src="/assets/posts/more-birds/egret.webp" />
    </div>
    <div class="col-12 col-6-md">
        <img alt="Great egret closeup" class="img-smooth" src="/assets/posts/more-birds/egret-closeup.webp" />
    </div>
</div>

<h2 id="illegally-fancy-bird">Illegally fancy bird</h2>

<p>I also saw a pheasant. He had zero survival instincts and did not seem to compute I was a human while I remained in my car. 
He <em>did</em> bolt when I got out, at least?</p>

<p>I hope he wasn’t raised in captivity and released for hunting because that shit makes me an enraged kind of sad.</p>

<p><img alt="Female common kestrel with her beak open, looking out small stone window" class="img-smooth" src="/assets/posts/more-birds/pheasant.webp" /></p>]]></content><author><name></name></author><category term="photography" /><summary type="html"><![CDATA[It’s not yet insect season (although they’re coming back!), so I’m making efforts to practice photography anyway, despite how heavy my bird photography gear is.]]></summary></entry><entry><title type="html">Birds everywhere.</title><link href="https://mostlypixels.com/2025/02/02/city-birding.html" rel="alternate" type="text/html" title="Birds everywhere." /><published>2025-02-02T00:00:00+01:00</published><updated>2025-02-02T00:00:00+01:00</updated><id>https://mostlypixels.com/2025/02/02/city-birding</id><content type="html" xml:base="https://mostlypixels.com/2025/02/02/city-birding.html"><![CDATA[<p>This weekend was Natagora’s “big garden bird census”, so I did what any sane urbanite with no garden would do: I commandeered a friend’s garden. 
I packed my 150-600mm lens (that I never use on account of it weighting 2kg), dusted the spider webs off my tripod, and went to sit outside in the cold, just to count birds.</p>

<p>Now, my most common experience with actually hauling the telephoto lens outside is: no birds. Zero. Extinct. Even pigeons vanish. <em>Not this weekend, though!</em> I was <em>blessed</em>.</p>

<h2 id="genuine-photograph-of-an-actual-angel">Genuine photograph of an actual angel</h2>

<p><img src="/assets/posts/bird-count/kestrel.webp" alt="Kestrel" class="img-smooth" /></p>

<p>I saw not just one, but <em>two</em> kestrels this weekend. On two separate days and in different locations. 
Absolute miracle, because I only ever see raptors on the side of highways while driving. But those were semi-urban.</p>

<p>The one on the picture seems to have settled on the roof of an events building in my city, so that kestrel has dominion over <em>two</em> parking lots, 
while also being right next a woody area and, a short flight away, pastures. Food is easily available in the form of city rats raiding the nearby trash cans, he only has to swoop down.
The bird’s living conditions are better than mine.</p>

<p><img src="/assets/posts/bird-count/kestrel2.webp" alt="Kestrel on roof" class="img-smooth" /></p>

<p>Just look at this smug fluffball. He doesn’t even pay rent.</p>

<h2 id="the-counting">The counting</h2>

<p>The kestrel thing was entirely separate from the whole “sitting in a stolen garden to watch birds for a census” thing. At the bird feeder, the visitors were a little more commonplace: tits. So many tits.</p>

<p><img src="/assets/posts/bird-count/bluetit1.webp" alt="Blue tit" class="img-smooth" /></p>

<p>The blue tits showed up in force. They are a gregarious and adventurous species, so of course whole groups dropped by and shouted their little heads off to alert everyone a human was there. They still went for the food. I love them.</p>

<p><img src="/assets/posts/bird-count/greattit1.webp" alt="Blue tit" class="img-smooth" /></p>

<p>Great tits came in lesser numbers, feet first, to shove the blue tits off the feeder. They are bullies and my least favorite of the Paridae.</p>

<p><img src="/assets/posts/bird-count/robin1.webp" alt="Robin in the bushes" class="img-smooth" /></p>

<p>One robin showed up - they’re solitary and territorial - very cautious, very annoyed I was there. It didn’t stick around (there was more bird food on a side of the house where I was not).</p>

<p>And then there was the Surprise-For-Everyone-Involved. I was minding my own business, stalking birds and spooking my best friend’s neighbours by pointing a telephoto lens at their houses, when a <em>huge</em> bird landed in the branches behind the bird feeder. 
And, before my inner catalogue of the local bird species could even boot (“That’s too big to be a tit…”), 
it saw me and bolted in the opposite direction (“…but it’s not black so it’s not a jackdaw…”), then landed on a tree on the other side of the garden to give me the stink eye (“…and it’s sure not a pigeon. Jay?”).</p>

<p>Probably thought I couldn’t see it anymore, but joke’s on it, I spend ungodly amounts of money on entirely overkill photography equipment.</p>

<h2 id="behold-the-power-of-zoom-lenses">Behold the power of zoom lenses</h2>

<p>It was a great spotted woodpecker.</p>

<p><img src="/assets/posts/bird-count/pecker.webp" alt="Robin in the bushes" class="img-smooth" /></p>

<p>I can’t tell if it was male or female (you need to check for a red spot on the back of the head, which only the males have, and I did not get a single shot showing it).</p>

<p>I’m going to have to steal my friend’s garden again to find out.</p>

<h2 id="a-cool-app">A cool app</h2>

<p>If you want a really amazing tool to help counting birds: <a href="https://merlin.allaboutbirds.org/">Merlin Bird ID</a></p>

<p>It’s incredibly good at identifying birds by sound. Highly recommended.</p>]]></content><author><name></name></author><category term="photography" /><summary type="html"><![CDATA[This weekend was Natagora’s “big garden bird census”, so I did what any sane urbanite with no garden would do: I commandeered a friend’s garden. I packed my 150-600mm lens (that I never use on account of it weighting 2kg), dusted the spider webs off my tripod, and went to sit outside in the cold, just to count birds.]]></summary></entry><entry><title type="html">I’m a Disney Princess now</title><link href="https://mostlypixels.com/zoom/2024/06/24/bumblebee-friend.html" rel="alternate" type="text/html" title="I’m a Disney Princess now" /><published>2024-06-24T00:00:00+02:00</published><updated>2024-06-24T00:00:00+02:00</updated><id>https://mostlypixels.com/zoom/2024/06/24/bumblebee-friend</id><content type="html" xml:base="https://mostlypixels.com/zoom/2024/06/24/bumblebee-friend.html"><![CDATA[<p>I’ve had the <em>best</em> bumblebee encounter in my life so far - a true Disney Princess moment - and I just wanted to share.</p>

<p>I was taking bug pics, because there’s sunlight in Belgium right now and I’m not about to waste it, and I was moving leaves and flowers to get better angles.</p>

<p>And this cutie climbed on my finger.</p>

<h2 id="behold-a-cutie">Behold, a cutie:</h2>

<p><img src="/assets/posts/bumblebee-friend/bee-friend-1.jpg" alt="Bumblebee on a fingertip" class="img-smooth" /></p>

<p>It didn’t just climb there: it <em>sat on my finger for more than twenty minutes</em>. Just… Sleeping, or cleaning its legs and antennae. 
Totally unperturbed. I seriously thought something was wrong with it so, after the first ten minutes of bee sleep, I got up and tried to find it a nice little spot.</p>

<p>And that would be how <em>many</em> people taking a stroll got to meet a weirdo holding up a hand and carrying a bumblebee.</p>

<p><img src="/assets/posts/bumblebee-friend/bee-friend-3.jpg" alt="Bumblebee on a fingertip" class="img-smooth" /></p>

<p>The bumblebee was fine, by the way.</p>

<p>I offered it puddle-water-droplets, but it didn’t want those. I showed it every flower on the way in case it was exhausted and hungry, it didn’t want them.</p>

<p>Then I used my secret weapon, “that huge pot of lavender at the end of the trail”. 
I showed it the lavender (which is THE place to be for all bees around), and it immediately climbed on and started foraging and flying from stalk to stalk.</p>

<p>So, entirely fine, just lazy. I can relate.</p>

<p>Truly magical moment, 10/10, would taxi bees around again.</p>]]></content><author><name></name></author><category term="zoom" /><category term="photography" /><category term="i-saw-a-bug" /><summary type="html"><![CDATA[I’ve had the best bumblebee encounter in my life so far - a true Disney Princess moment - and I just wanted to share.]]></summary></entry><entry><title type="html">Mining bees</title><link href="https://mostlypixels.com/zoom/2024/03/21/mining-bees.html" rel="alternate" type="text/html" title="Mining bees" /><published>2024-03-21T00:00:00+01:00</published><updated>2024-03-21T00:00:00+01:00</updated><id>https://mostlypixels.com/zoom/2024/03/21/mining-bees</id><content type="html" xml:base="https://mostlypixels.com/zoom/2024/03/21/mining-bees.html"><![CDATA[<p>I switched my work hours to four days a week, to do the healthy thing as a screen-addicted forty-something: go touch grass. 
I was to exit the house, hike, reach that impossible “10k daily steps” target, maybe play Pokemon Go… You know. Exercise.</p>

<p>That plan was thwarted by bees.</p>

<p>I walked a whole 22 steps this Wednesday. Got out of my car, stepped onto a dirt trail between fields and train tracks, and immediately sat down to look at bees until sunset. <em>Right</em> where the trail started.</p>

<p>Can you blame me, though? <em>Look at this face.</em></p>

<p><img src="/assets/posts/mining-bees/miningbee.webp" alt="Macro photograph of a mining bee looking out the opening of a burrow in the dirt" class="img-smooth" /></p>

<h2 id="the-grey-backed-mining-bee-andrena-vaga">The grey-backed mining bee, Andrena vaga</h2>

<p><small class="is-small">I am not an expert, and you might want to fact-check with entomologists.</small></p>

<p>The grey-backed mining bees - a species of solitary bee - live in Europe (and other places) and feed primarily on willow pollen.</p>

<p>They are black and shiny, with a <del>fluffy</del> thorax covered in grey hair.
The males have distinctive white “beards”, but I did not get good pictures of males. I <em>think</em> this is one, though:</p>

<p><img src="/assets/posts/mining-bees/male.webp" alt="Side view of a bee" class="img-smooth" /></p>

<ul>
  <li><a href="https://oabeilles.net/wp-content/uploads/2016/01/OAAndrenevague.pdf">External source with a good picture, in French.</a></li>
</ul>

<p>The females burrow into the ground to nest. While the nests are individual, many bees might nest in the same area, which looks like this:</p>

<p><img src="/assets/posts/mining-bees/burrows.webp" alt="Several bees peeking out of their nests" class="img-smooth" /></p>

<h2 id="the-digging">The digging</h2>

<p>I filmed it.</p>

<div class="text-center">
<iframe width="560" height="315" src="https://www.youtube.com/embed/TFX8ifU9SQM?si=vreAy_BzciBwKYhw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
</div>

<p>Note: this is not the “brand new tunnel” process. This lazy little one was reopening an existing nest. I saw another bee dig a new tunnel and a lot more effort, time and spinning was involved.</p>

<h2 id="extra-pics">Extra pics</h2>

<p><img src="/assets/posts/mining-bees/adrena1.webp" alt="Front view of bee" class="img-smooth" />
<img src="/assets/posts/mining-bees/adrena2.webp" alt="Side view of bees" class="img-smooth" /></p>]]></content><author><name></name></author><category term="zoom" /><category term="photography" /><category term="i-saw-a-bug" /><summary type="html"><![CDATA[I switched my work hours to four days a week, to do the healthy thing as a screen-addicted forty-something: go touch grass. I was to exit the house, hike, reach that impossible “10k daily steps” target, maybe play Pokemon Go… You know. Exercise.]]></summary></entry><entry><title type="html">I always wanted a microscope</title><link href="https://mostlypixels.com/zoom/2024/03/07/microscope.html" rel="alternate" type="text/html" title="I always wanted a microscope" /><published>2024-03-07T00:00:00+01:00</published><updated>2024-03-07T00:00:00+01:00</updated><id>https://mostlypixels.com/zoom/2024/03/07/microscope</id><content type="html" xml:base="https://mostlypixels.com/zoom/2024/03/07/microscope.html"><![CDATA[<p>I always wanted a microscope.</p>

<p>I did. I added them to all my Santa lists and birthday lists, up until the point I actually got my hands on a microscope. 
It was <em>underwhelming</em>. Whatever it was showing me, it was not what I wanted. 
So, I stopped pestering my relatives to get me one, and kept receiving truckloads of board games instead (which was also underwhelming because, back then, I was a single child).</p>

<p>Then I became an adult, and then (<em>much</em> later) I got disposable income, and then I got myself a microscope. And it still sucked.</p>

<p>It could have ended there. I could have had <em>savings</em>. But no. I <em>had</em> to impulse buy a camera, and figure out what I <em>actually</em> craved for: “macro photography”.</p>

<p>I want to “zoom, enhance, zoom, enhance” stuff like I’m on CSI.</p>

<h2 id="behold-a-flower">Behold! A <em>flower</em>.</h2>

<p><img src="/assets/posts/microscope/cherry.webp" alt="Macro photograph of a cherry blossom" class="img-smooth" /></p>

<p>I went and got myself extension tubes (which are, basically, <em>tubes</em>, which you put between the lens and the camera to get a better magnification). 
As every single purchase of photography gear, it got me to investigate and order <em>more</em> gear, because photography is a hellish hobby, and you should NEVER TRY IT.</p>

<p>But, anyway, I am very happy to get to see small things, but bigger, and I immediately tested the extension tubes + my macro lens on a flower <del>after trying and failing to take decent shots of insects</del>. Flowers are nice, because they don’t scamper off, unless there’s wind. And if there’s wind, you can just hold them. <em>Nobody will know</em>.</p>

<h2 id="back-to-the-zooming">Back to the zooming</h2>

<p>Thanks to the tubes, I can now get pretty stunning detail on bugs that are around 4-5 mm, like this mite :</p>

<p><img src="/assets/posts/microscope/mite.webp" alt="A red spider macro shot" class="img-smooth" /></p>

<p>It’s however even harder to get proper exposure <em>and</em> focus, which means I’ll have to practice. A lot.</p>

<p>I struggle with insects because they are small, they move, and sometimes they fly up trees when they notice me. Getting the proper combination of shutter speed and aperture kind of requires the star<del>s</del> to align. 
Not enough sunlight, and every picture is underexposed; if the sun is too high, the contrast is awful.</p>

<p>Also, even when the sun is where I need it, I can still get the aperture wrong, and only a millimeter thin slice of the bug will be in focus.</p>

<p>My solution to this is to throw obscene amounts of money at the local photography store. The <em>proper</em> solution is practice.</p>

<p>Wish me luck and an attention span!</p>

<h2 id="bonus-photobombing">Bonus: Photobombing</h2>

<p>No extension tubes for this one, but here’s the <em>true</em> “outside macro” experience: a tiny bug peeking in while you’re taking pics of something else entirely.</p>

<p><img src="/assets/posts/microscope/bee.webp" alt="Bee foraging on a willow bud, with a tiny bug on the bud" class="img-smooth" /></p>

<p><img src="/assets/posts/microscope/bee_detail.webp" alt="irch catkin bug detail" class="img-smooth" /></p>]]></content><author><name></name></author><category term="zoom" /><category term="photography" /><summary type="html"><![CDATA[I always wanted a microscope.]]></summary></entry><entry><title type="html">Bug &amp;amp; Seek</title><link href="https://mostlypixels.com/gaming/2024/02/05/bug-and-seek.html" rel="alternate" type="text/html" title="Bug &amp;amp; Seek" /><published>2024-02-05T00:00:00+01:00</published><updated>2024-02-05T00:00:00+01:00</updated><id>https://mostlypixels.com/gaming/2024/02/05/bug-and-seek</id><content type="html" xml:base="https://mostlypixels.com/gaming/2024/02/05/bug-and-seek.html"><![CDATA[<p>It’s winter right now, and winter is <em>awful</em>.</p>

<p>I like taking pictures of bugs. I have limited skills as a photographer, 
so I need a specific combination of circumstances to <del>take okay pictures</del> match my aesthetic: 
a sunny day, that “15 minutes window of time” when the sun is at the right angle, pretty leaves, and <em>bugs</em>. The bugs are somewhat critical.</p>

<p>The wet Belgian winter has not been helpful.</p>

<h2 id="enter-bug--seek">Enter “Bug &amp; Seek”</h2>

<p><img src="/assets/posts/bug-and-seek/title.webp" alt="Title screen" class="img-smooth" /></p>

<p><a href="https://www.sopeculiar.com/bugandseek">Bug &amp; Seek</a> is a cute bug-catching / simulation game. You play as the new owner of the town of Buggburg’s insectarium, 
and endeavor to fill it with the insects you catch, while also:</p>

<ul>
  <li>investigating the mysterious robbery that happened before you arrived</li>
  <li>filling up your codex</li>
  <li>helping the residents by catching bugs for them</li>
  <li>helping local children with their questionable pet choices.</li>
</ul>

<p>Exactly what Steam needed to put in front of my face to guarantee a sale, in this wet Belgian winter.</p>

<h2 id="the-game">The game</h2>

<p>There are <em>many</em> bugs to catch (175+), which appear depending on the season, biome, time of the day, and type of hiding spot.</p>

<p><img src="/assets/posts/bug-and-seek/screen3.webp" alt="Catching a bug" class="img-smooth" /></p>

<p>They come with a little catchphrase—</p>

<p>Did I mention it’s pixel art? It’s <em>pixel art</em>, people.</p>

<p><img src="/assets/posts/bug-and-seek/screen1.webp" alt="Species discovered screen" class="img-smooth" /></p>

<p>Ahem. They come with funny little catchphrases, but also informative codex entries, which are a delight to read.</p>

<p>Warning: you might end up on the internet at two in the morning, investigating trivia such as “attended by ants for honeydew” and “burn their enemies alive”.</p>

<p><img src="/assets/posts/bug-and-seek/screen2.webp" alt="Codex" class="img-smooth" /></p>

<p>You also gradually enhance and decorate the insectarium, improve your catching skills — which allows you to catch rarer insects — and help build the university’s collection.</p>

<h2 id="conclusion">Conclusion</h2>

<p>It’s cute, I love it. If you’re into insects, chances are you’ll like it too!</p>]]></content><author><name></name></author><category term="gaming" /><category term="gaming" /><summary type="html"><![CDATA[It’s winter right now, and winter is awful.]]></summary></entry><entry><title type="html">Why smol images are better</title><link href="https://mostlypixels.com/webdesign/2023/12/15/smol-images.html" rel="alternate" type="text/html" title="Why smol images are better" /><published>2023-12-15T00:00:00+01:00</published><updated>2023-12-15T00:00:00+01:00</updated><id>https://mostlypixels.com/webdesign/2023/12/15/smol-images</id><content type="html" xml:base="https://mostlypixels.com/webdesign/2023/12/15/smol-images.html"><![CDATA[<p class="text-center">(A.K.A.: performance matters)</p>

<p>I went to school for websites back in ‘00, ‘03, when everything was made of tables and spacer.gif, and you had to keep your entire website under 150kb or you failed your class. 
So gather ‘round, children, and listen to the questionable wisdom of a woman who has <em>refused</em> to touch any sort of HTML since the advent of responsive design.</p>

<p><small class="is-small">(I am not an expert.)</small></p>

<h2 id="whats-this-rambling-about">What’s this rambling about?</h2>

<p>We’re going to be covering a few assorted topics:</p>

<ul>
  <li>Why nuking your visitors’ mobile data is bad</li>
  <li>How to check if your website is too heavy</li>
  <li>What to do about it
    <ul>
      <li>image-side</li>
      <li>HTML-side</li>
    </ul>
  </li>
</ul>

<p>It’s not super complicated, but I <em>really</em> like run-on sentences and sound very condescending.</p>

<h2 id="why-is-file-size-so-important">Why is file size so important?</h2>

<p><strong>Heavier</strong> images are <strong>slower</strong> to load, and your visitors might find themselves staring at your art gallery, waiting for each picture to load. Slooooowly. Sloooowly. Line by line. Some of those visitors have ADHD (I am referring to nobody in particular and especially not me). They’re gone.</p>

<p>More importantly, <strong>mobile data</strong> comes in various package sizes, and some people have <strong>less than 1gb/month</strong>. Throwing 100mb of images at them on a single page is downright <em>cruel</em>.</p>

<h2 id="did-i-sin-are-my-images-too-heavy">Did I sin? Are my images too heavy?</h2>

<p>There are quite a few good <strong>tools</strong> that will <strong>analyze</strong> a page and tell you everything wrong with it. Today, we are going to use <a href="https://pagespeed.web.dev/">PageSpeed Insights</a>.</p>

<p>Grab your <strong>site URL</strong> (preferably the page with the most images) and throw it into the <strong>form</strong>. Submit. Get a cup of tea. Come back to a soul-crushing <strong>report</strong> that gives you:</p>

<ul>
  <li><strong>Scores</strong> (for mobile and desktop)</li>
  <li>Acronyms</li>
  <li>Judgement</li>
  <li>A laundry list of <strong>recommendations</strong></li>
</ul>

<p>Now search the report for the words <strong>“Avoid enormous network payloads”</strong>. If you don’t find it, you did good :3</p>

<figure class="bordered img-smooth">

<figcaption>Example</figcaption>
<figure>

<img src="/assets/posts/smol-images/pagespeed.png" alt="A PageSpeed screenshot showing a summary of heavy assets" class="bd-dark" />

<figcaption>
<p>For illustrative purposes, I fed PageSpeed Insights the "gallery" page of a random website.
Not naming names. Maybe it was <em>you</em>.</p>
<p>
"Total size was 97,471 KiB" is, uh, <em>not</em> good. There's a few reasons something like this can happen, but here it's a simple issue:
the gallery is squishing down each artwork rather than using smaller thumbnails, and each picture is quite heavy.
</p> 

</figcaption>
</figure>

</figure>

<h2 id="how-to-fix-it">How to fix it?</h2>

<h3 id="smol-images">Smol images</h3>

<p>We are going to take the “Peter Pan” approach to things growing too much:</p>

<blockquote>
  <p>The boys on the island vary, of course, in numbers, according as they get killed and so on; and when they seem to be growing up, which is against the rules, <strong>Peter thins them out</strong>; (…)</p>
</blockquote>

<p>There are various ways to make images “thinner”:</p>

<h4 id="using-adequate-dimensions">Using adequate dimensions</h4>

<p>Determine the <strong>largest width/height</strong> the image will be displayed at on your page. If your layout is 1200px wide, <strong>resize</strong> larger images to match that size it in an external editor. Create small thumbnails and link to the large file if needed.</p>

<p>Some screens have a higher pixel resolution, and need alternate larger pictures to display, we’ll cover that in the HTML part!</p>

<h4 id="using-an-adequate-file-format">Using an adequate file format</h4>

<p>We have the oldies:</p>

<ul>
  <li><strong>JPGs</strong> are better for photography, and lossy.</li>
  <li><strong>PNGs</strong> are heavy but can have use alpha transparency.</li>
  <li><em>Indexed</em> <strong>PNGs</strong> (fixed palette with max. 256 colors) are good for
pixel art with flat transparency but no animations.</li>
  <li><strong>GIFs</strong> have an indexed palette too, and <em>they</em> handle animation.
Good for pixel art and such. Not supposed to be used for TV show
sequences, but the internet decided otherwise.</li>
</ul>

<p>Then we have <strong>modern formats</strong>:</p>

<ul>
  <li><strong>WebP</strong></li>
  <li><strong>AVIF:</strong> open file format and <em>really cool</em> but not yet supported
by Edge, so we’ll skip it until Microsoft gets its s*** together.</li>
</ul>

<p><img src="/assets/meme/annie-can-do-better.webp" alt="A screenshot of &quot;Annie Get your gun&quot;" /></p>

<p>♫ Everything <del>you</del> the old formats can do, <del>I</del> WebP can do better. ♫</p>

<p>Or, at least, <strong>WebP</strong> tries its very best. It offers very good
<strong>compression</strong>, handles <strong>animation</strong> and <strong>transparency</strong> … So, unless converting your
original image to WebP horribly mangles it (or somehow makes it
heavier), <em>use WebP</em>. It’s <a href="https://caniuse.com/webp">well supported</a>.</p>

<p><del>Internet Explorer doesn’t count.</del></p>

<h4 id="i-am-not-converting-my-24871-images-by-hand">“I am not converting my 24871 images by hand!”</h4>

<p><a href="https://saerasoft.com/caesium">Caesium Image Compressor</a> has you
covered!</p>

<p class="text-center">
<a href="https://saerasoft.com/caesium">
<img src="/assets/posts/smol-images/caesium.webp" class="img-smooth " />
</a>
</p>

<p>It has every feature you’ll need to quickly <strong>convert</strong> all (and by that I
mean “most”) of your images to WebP:</p>

<ul>
  <li>It can load <strong>folders</strong> <em>recursively</em> and save the compressed images to
the same folder</li>
  <li>It has various <strong>resize</strong> options (percentage, dimensions, fit width or
height)</li>
  <li>It can add <strong>suffixes</strong> to the saved files</li>
</ul>

<p>Which means you can generate “my-birb_thumbnail.webp”,
“my-birb_small.webp” and “my-birb_full.webp” from “my-birb.jpg” within
minutes, for 24871 images if necessary.</p>

<h5 id="other-tools">Other tools</h5>

<ul>
  <li><a href="https://tinypng.com/">TinyPNG:</a> Optimize images online</li>
  <li><a href="https://www.websiteplanet.com/webtools/imagecompressor/">Website Planet compressor:</a> Alternate optimizer (no Webp)</li>
</ul>

<h2 id="fancy-html">Fancy HTML</h2>

<p>To accommodate the many screen sizes an resolutions out there, there’s
<strong>responsive images</strong>.</p>

<p>The website provides a <strong>base image</strong> and <strong>alternate versions</strong>, and some
instructions on when to use them. The browser picks the best for the
current viewport. Which is why I introduced you to Caesium Image
Compressor three paragraphs ago. You’ll need it.</p>

<p>Now brace for confusion, although I’m just going to tell that you that
features <em>exist</em>, and that smarter people have written better
tutorials.</p>

<h3 id="the-srcset-attribute">The “srcset” attribute</h3>

<p>The <strong>simplest</strong> way to handle responsive images. It’s a straightforward
way to display the <strong>same image</strong>, but in <strong>different sizes</strong>, with the browser picking the best size.</p>

<p>The <code class="language-plaintext highlighter-rouge">srcset</code> attribute is used on the image tag:</p>

<figure class="highlight"><pre><code class="language-html" data-lang="html">  <span class="nt">&lt;img</span> <span class="na">src=</span><span class="s">"birb.webp"</span> <span class="na">srcset=</span><span class="s">"birb.webp, birb-2x.webp 2x"</span><span class="nt">&gt;</span></code></pre></figure>

<p>Defining the <code class="language-plaintext highlighter-rouge">srcset</code> comes with various degrees of complexity. You
can target:</p>

<ul>
  <li>the <strong>pixel density</strong> of the screen, using pixel density descriptors (1x, 2x, 3x), so larger images can be used on devices with a higher resolution.</li>
  <li>the <strong>viewport’s width</strong>, by providing the width of the images: for an image that is 300px wide, we use the “300w” descriptor. <em>Pixel density impacts this</em>.</li>
  <li>Precise <strong>sizes</strong>, by adding a “sizes” attribute. It allows for more fine-tuning. You list the various sizes of the image in the <code class="language-plaintext highlighter-rouge">srcset</code> attribute, and “media conditions”, like the maximal size of the viewport, and the available “slot” width to occupy.</li>
</ul>

<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;img</span>
  <span class="na">srcset=</span><span class="s">"birb-400w.jpg 400w, birb-750w.jpg 750w"</span>
  <span class="na">sizes=</span><span class="s">"(max-width: 500px) 400px, 750px"</span>
  <span class="na">src=</span><span class="s">"birb-750w.jpg"</span>
  <span class="na">alt=</span><span class="s">"A bird"</span> 
<span class="nt">&gt;</span></code></pre></figure>

<h3 id="the-picture-tag">The “picture” tag</h3>

<p>It can be used when you want:</p>

<ul>
  <li>a <strong>fallback</strong> image for <strong>older browsers</strong> that do not support WebP.</li>
  <li><strong>different images</strong> depending on the situation: to change the <strong>image orientation</strong>, to display cropped pictures on phones so the details are clearer…</li>
</ul>

<p>Here is an example that does both:</p>

<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;picture&gt;</span>
  <span class="nt">&lt;source</span> <span class="na">media=</span><span class="s">"(max-width: 582px)"</span> <span class="na">srcset=</span><span class="s">"robin-portrait.webp"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;source</span> <span class="na">media=</span><span class="s">"(min-width: 583px)"</span> <span class="na">srcset=</span><span class="s">"robin-landscape.webp"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;img</span> <span class="na">src=</span><span class="s">"robin-landscape.jpg"</span> <span class="na">alt=</span><span class="s">"A robin"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/picture&gt;</span></code></pre></figure>

<p>If you resize your browser window, this robin should switch between a portrait closeup and a landscape picture:</p>

<picture class="is-center">
  <source media="(max-width: 582px)" srcset="/assets/posts/smol-images/robin-portrait.webp" />
  <source media="(min-width: 583px)" srcset="/assets/posts/smol-images/robin-landscape.webp" />
  <img src="/assets/posts/smol-images/robin-landscape.jph" alt="A robin" />
</picture>

<h2 id="documentation">Documentation</h2>

<p>As I said earlier, smarter people wrote about this ;)</p>

<ul>
  <li><a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images">Mdn: Responsive images</a></li>
  <li><a href="https://coderpad.io/blog/development/the-definitive-guide-to-responsive-images-on-the-web/">The Definitive Guide To Responsive Images On The Web</a></li>
</ul>]]></content><author><name></name></author><category term="webdesign" /><category term="css" /><summary type="html"><![CDATA[(A.K.A.: performance matters)]]></summary></entry><entry><title type="html">A javascript screensitter</title><link href="https://mostlypixels.com/webdesign/2023/12/04/js-screensitter.html" rel="alternate" type="text/html" title="A javascript screensitter" /><published>2023-12-04T00:00:00+01:00</published><updated>2023-12-04T00:00:00+01:00</updated><id>https://mostlypixels.com/webdesign/2023/12/04/js-screensitter</id><content type="html" xml:base="https://mostlypixels.com/webdesign/2023/12/04/js-screensitter.html"><![CDATA[<p>Back in <em>forever ago</em>, I was utterly obsessed with everything you could download from <a href="https://otakuworld.com/">Otakuworld</a>. I loved the KiSS dolls, the toy chest, and particularly 
<a href="https://otakuworld.com/index.html?/toys/preview/toys/awrei.html">the</a>
<a href="https://otakuworld.com/index.html?/toys/preview/toys/sakurae.html">screen</a>
<a href="https://otakuworld.com/index.html?/toys/preview/toys/awmul302.html">sitters</a>.</p>

<p>They don’t work anymore and I am sad. <em>Anyway.</em> I wanted some, and windows wouldn’t cooperate, so I <em>made</em> some. But at the website level because I am a “web” dev.</p>

<p class="is-center"><img src="/assets/posts/js-screensitter/sitter-example.png" alt="Sitter example" /></p>

<h2 id="the-script">The script</h2>

<h3 id="what-it-does">What it does</h3>

<p>You give it image urls and a few parameters. It will create an image element in your html, then move it to the upper right corner of elements that have a class of your choice.</p>

<p>You’ll have to draw your own images because I’m lazy and didn’t make samples ;)</p>

<h3 id="how-to-use-it">How to use it</h3>

<p>First, add the script to your page. You can <a href="https://github.com/mostlypixels/mpscreensitter">download the javascript file</a> on Github.</p>

<figure class="highlight sit_here"><pre><code class="language-html" data-lang="html">  <span class="nt">&lt;script </span><span class="na">src=</span><span class="s">"/assets/js/mp-screensitter.js"</span><span class="nt">&gt;&lt;/script&gt;</span></code></pre></figure>

<p>Then, include this javascript at the bottom of the page, and change the parameters as needed.</p>

<figure class="highlight sit_here"><pre><code class="language-javascript" data-lang="javascript"><span class="o">&lt;</span><span class="nx">script</span><span class="o">&gt;</span>
<span class="nb">window</span><span class="p">.</span><span class="nf">addEventListener</span><span class="p">(</span><span class="dl">"</span><span class="s2">load</span><span class="dl">"</span><span class="p">,</span><span class="kd">function</span><span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">new</span> <span class="nc">MpScreensitter</span><span class="p">(</span>
        <span class="p">{</span>
            <span class="na">seat_class</span><span class="p">:</span> <span class="dl">'</span><span class="s1">seat</span><span class="dl">'</span><span class="p">,</span>  
            <span class="na">sitter_class</span><span class="p">:</span> <span class="dl">'</span><span class="s1">sitter</span><span class="dl">'</span><span class="p">,</span> 
            <span class="na">sitter_images</span><span class="p">:</span> <span class="p">[</span>
                <span class="dl">'</span><span class="s1">./sitter.gif</span><span class="dl">'</span><span class="p">,</span>
                <span class="dl">'</span><span class="s1">./sitter2.gif</span><span class="dl">'</span><span class="p">,</span>
            <span class="p">],</span>
            <span class="na">sitter_offset_x</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span> 
            <span class="na">sitter_offset_y</span><span class="p">:</span> <span class="mi">14</span><span class="p">,</span> 
        <span class="p">}</span>
    <span class="p">);</span>
<span class="p">},</span><span class="kc">false</span><span class="p">);</span>
<span class="o">&lt;</span><span class="sr">/script&gt;</span></code></pre></figure>

<h3 id="parameters">Parameters</h3>

<p>They are all optional, but tweaking of the offsets will be needed if your image goes over the box it sits on.</p>

<p>The “sitter_images” array should also contain your images with their proper path.</p>

<dl>
  <dt>seat_class (default: “seat”)</dt>
  <dd>The <em>CSS class</em> of the elements to target. You can have multiple “sitters” on a page if you target different classes. The target elements cannot be inline!</dd>
  <dt>sitter_class (default: “sitter”)</dt>
  <dd>The class of the sitter image</dd>
  <dt>sitter_images (default: [’./sitter.gif’] )</dt>
  <dd>A list of the possible sitter images. One will be selected at random the target box changes.</dd>
  <dt>sitter_offset_x (default: 0)</dt>
  <dd>Distance from the right side of the box in pixels</dd>
  <dt>sitter_offset_y (default: 0)</dt>
  <dd>Vertical offset in pixels. The “legs’” size</dd>
</dl>

<hr />

<p class="is-center"><a href="https://github.com/mostlypixels/mpscreensitter" class="button primary">Get the script on Github</a></p>

<script>
    window.addEventListener("load",function(event) {
        new MpScreensitter(
            {
                seat_class: 'sit_here',
                sitter_class: 'sitter',
                sitter_images: [
                    '/assets/img/sitter3.gif',
                ],
                sitter_offset_x: 10,
                sitter_offset_y: 14,
            }
        );
    },false);
</script>]]></content><author><name></name></author><category term="webdesign" /><category term="javascript" /><summary type="html"><![CDATA[Back in forever ago, I was utterly obsessed with everything you could download from Otakuworld. I loved the KiSS dolls, the toy chest, and particularly the screen sitters.]]></summary></entry><entry><title type="html">Css variables are super useful</title><link href="https://mostlypixels.com/webdesign/2023/12/02/css-variables.html" rel="alternate" type="text/html" title="Css variables are super useful" /><published>2023-12-02T00:00:00+01:00</published><updated>2023-12-02T00:00:00+01:00</updated><id>https://mostlypixels.com/webdesign/2023/12/02/css-variables</id><content type="html" xml:base="https://mostlypixels.com/webdesign/2023/12/02/css-variables.html"><![CDATA[<p>I moved to backend development more than a decade ago and returning to webdesign is <em>wild</em>. Turns out features I would have sold my soul for back in the 00’s actually <em>exist</em> now. Like the <code class="language-plaintext highlighter-rouge">calc()</code> function, the <code class="language-plaintext highlighter-rouge">aspect-ratio</code> property, and COLRv1 fonts.</p>

<p>But <strong>css variables</strong> are my new favorite thing.</p>

<h2 id="but-what-are-those">But what <em>are</em> those?</h2>

<p>Variables store values, and can be accessed in other parts of your stylesheet, to apply said values to various elements.</p>

<p>Instead of finding and replacing a color, font, etc. everywhere you used it, you can instead define it in one place and change it there.</p>

<h2 id="declaring-variables">Declaring variables</h2>

<p>You can declare your variables inside a selector.</p>

<p>The simplest way to do it is to use the <code class="language-plaintext highlighter-rouge">:root</code> selector, which will make the variables accessible globally.</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nd">:root</span> <span class="p">{</span>
    <span class="py">--my-color</span><span class="p">:</span> <span class="m">#fff</span><span class="p">;</span>
<span class="p">}</span></code></pre></figure>

<p>You can then call that variable in other selectors, using the <code class="language-plaintext highlighter-rouge">var()</code> function, like this:</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nc">.my-class</span> <span class="p">{</span>
    <span class="nl">color</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--my-color</span><span class="p">);</span>
<span class="p">}</span></code></pre></figure>

<h2 id="variables-in-action">Variables in action</h2>

<p>Let’s make a very, very simple example with minimal html.</p>

<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"tut-demo"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;header&gt;</span>Title<span class="nt">&lt;/header&gt;</span>
    <span class="nt">&lt;div&gt;</span>My fancy content<span class="nt">&lt;/div&gt;</span>
<span class="nt">&lt;/div&gt;</span></code></pre></figure>

<p>That isn’t very fancy, so let’s give it a makeover. In our <strong>css file</strong>, let’s define the variables we will need: colors, a border radius…</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nd">:root</span> <span class="p">{</span>
    <span class="py">--tut-bg-primary</span><span class="p">:</span> <span class="m">#fff</span><span class="p">;</span>
    <span class="py">--tut-bg-secondary</span><span class="p">:</span> <span class="m">#8f0b42</span><span class="p">;</span>
    <span class="py">--tut-color-primary</span><span class="p">:</span> <span class="m">#17181c</span><span class="p">;</span>
    <span class="py">--tut-color-secondary</span><span class="p">:</span> <span class="m">#fff</span><span class="p">;</span>
    <span class="py">--tut-border-radius</span><span class="p">:</span> <span class="m">20px</span><span class="p">;</span>
<span class="p">}</span></code></pre></figure>

<p>And then, let’s use the variables in our selectors.</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nc">.tut-demo</span> <span class="p">{</span>
    <span class="nl">background</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-bg-primary</span><span class="p">);</span>
    <span class="nl">color</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-color-primary</span><span class="p">);</span>
    <span class="nl">border-radius</span><span class="p">:</span> <span class="n">calc</span><span class="p">(</span><span class="n">var</span><span class="p">(</span><span class="n">--tut-border-radius</span><span class="p">)</span> <span class="err">*</span> <span class="m">1.5</span><span class="p">);</span>
    <span class="nl">border</span><span class="p">:</span> <span class="m">2px</span> <span class="nb">solid</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-bg-secondary</span><span class="p">);</span>
<span class="p">}</span>

<span class="nc">.tut-demo</span> <span class="nt">header</span> <span class="p">{</span>
    <span class="nl">border-radius</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-border-radius</span><span class="p">);</span>
    <span class="nl">background</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-bg-secondary</span><span class="p">);</span>
    <span class="nl">color</span><span class="p">:</span> <span class="n">var</span><span class="p">(</span><span class="n">--tut-color-secondary</span><span class="p">);</span>
<span class="p">}</span></code></pre></figure>

<p>And here we are. Behold, our fancy block:</p>

<div class="tut-demo">
    <header>Title</header>
    <div>My fancy content</div>
</div>

<h3 id="and-now-we-switch-themes">And now we switch themes!</h3>

<p>CSS variables can be <strong>redefined</strong> inside selectors, which allows for quite a bit of customisation with minimal code.</p>

<p>You don’t have to redefine every variable. You can do this:</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nc">.tut-demo-blue</span> <span class="p">{</span>
    <span class="py">--tut-bg-secondary</span><span class="p">:</span> <span class="m">#3d9bbd</span><span class="p">;</span>
<span class="p">}</span></code></pre></figure>

<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"tut-demo tut-demo-blue"</span><span class="nt">&gt;</span></code></pre></figure>

<div class="tut-demo tut-demo-blue">
    <header>Title</header>
    <div>My fancy content</div>
</div>

<p>Or you can do this:</p>

<figure class="highlight"><pre><code class="language-css" data-lang="css"><span class="nc">.tut-demo-yellow</span> <span class="p">{</span>
    <span class="py">--tut-bg-primary</span><span class="p">:</span> <span class="m">#3f3f3f</span><span class="p">;</span>
    <span class="py">--tut-bg-secondary</span><span class="p">:</span> <span class="m">#ffc771</span><span class="p">;</span>
    <span class="py">--tut-color-primary</span><span class="p">:</span> <span class="m">#ffffff</span><span class="p">;</span>
    <span class="py">--tut-color-secondary</span><span class="p">:</span> <span class="m">#000000</span><span class="p">;</span>
    <span class="py">--tut-border-radius</span><span class="p">:</span> <span class="m">0px</span><span class="p">;</span>
<span class="p">}</span></code></pre></figure>

<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"tut-demo tut-demo-yellow"</span><span class="nt">&gt;</span></code></pre></figure>

<div class="tut-demo tut-demo-yellow">
    <header>Title</header>
    <div>My fancy content</div>
</div>

<p>It makes <em>everything</em> easier.</p>

<p>Want a day/night theme? Change the colors. Change the images.
Want to make things a bit easier on your dyslexic visitors? Change the fonts, the line height and letter spacing. Or you can just be creative and have a custom design by page.</p>

<h2 id="theme-switching-demo">Theme switching demo</h2>

<div id="tut-demo" class="tut-demo">
    <header>Title</header>
    <div>My fancy content</div>
</div>

<p class="text-center"><button id="tuto-default" class="button primary">Default</button> <button id="tuto-blue" class="button primary">Blue</button> <button id="tuto-yellow" class="button primary">Yellow</button></p>

<link rel="stylesheet" href="/assets/css/css-variables-tutorial.css" />

<script src="/assets/js/css-variables-tutorial.js"></script>]]></content><author><name></name></author><category term="webdesign" /><category term="css" /><summary type="html"><![CDATA[I moved to backend development more than a decade ago and returning to webdesign is wild. Turns out features I would have sold my soul for back in the 00’s actually exist now. Like the calc() function, the aspect-ratio property, and COLRv1 fonts.]]></summary></entry></feed>