Open-source News

5 open source tips to reduce waste in web design

opensource.com - Thu, 04/21/2022 - 15:00
5 open source tips to reduce waste in web design Tom Greenwood Thu, 04/21/2022 - 03:00 Up Register or Login to like.

I started my career in product design, when "product" meant a real thing that you could hold in your hand. When I moved into digital design 15 years ago, I was excited to design digital products that added value to people's lives without any environmental impact. They didn't waste energy, didn't have any wasteful packaging and didn't end up as waste in landfill sites at the end of their lives.

Therefore, I was surprised to later learn that digital products can be wasteful. In this article, I explore how applying a zero waste mindset to digital design and development can help you create an internet that's better for people and the planet.

Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java Waste isn't normal

I think it's fair to say that even if we don't like it, most of us accept waste as a normal part of everyday life. However, waste is anything but normal. In nature no resource is wasted and everything has value. The type of waste that we now think of as being so normal is a relatively new concept.

By the 1980s, waste piling up in landfill sites was already a global problem. Daniel Knapp decided that something must be done. He came up with the concept of Total Recycling, in which nothing should ever go to a landfill or incineration. He coined the term Zero Waste as the goal and co-founded a salvaging operation called Urban Ore. It was a real world experiment to demonstrate how all types of waste could be diverted from landfills and reused in the community.

While Knapp's initiative had some success, the global waste problem kept growing and in the mid-2000s a growing number of individuals began to take things into their own hands, trying to live zero waste lifestyles. This concept was popularized by bloggers such as Bea Johnson and Lauren Singer who shared their experiences trying to live without waste and inspired others to follow their lead.

How does this apply to web design?

Several years ago, I embarked on some research to understand whether or not web products have an environmental impact. I was shocked by what I found. When taken as a whole, the internet produces more carbon emissions each year than the global aviation industry, thanks to the huge amount of electricity required to power data centers, telco networks, and billions of end user devices. Not to mention the fact that all of that equipment needs to be manufactured and maintained. The internet is not virtual at all, it is very much physical.

It turns out that despite their basic functionality and appearances, early websites were super efficient, with tiny file sizes and requiring hardly any computing power. As computers got more powerful and internet speeds increased, websites became increasingly bloated, eroding the benefits of advances in computer hardware. As a result, the modern web is no faster than it was 10 years ago, and is far more polluting.

In an article for National Geographic about people living zero waste lifestyles, journalist Stephen Leahy wrote that contrary to his prior assumption, "These are not wannabe hippies, but people embracing a modern minimalist lifestyle. They say it saves them money and time and enriches their lives."

What if we applied a zero waste mindset to digital design? Could it help us create a modern, minimalist web that saves people time, money, and enriches people's lives? I think it could.

1. Pictures are more than a thousand words

A picture tells a thousand words, but the truth is that a picture uses a lot more data than 1000 words of text, and in turn it uses a lot more energy to store, transmit, and render.

Research by NielsenNorman Group found that website visitors completely ignore images that are not relevant to the content, making generic stock photos on websites a literal waste of space and of data. It's better to use images mindfully and only include them in designs that truly add value.

Even if you are going to include photos in your designs, how you use them can often be wasteful. For example, there is roughly a square law when it comes to image dimensions and file size. If you double the width and height, you almost quadruple the file size. And that's assuming you've written the code to load the correct size of image rather than loading large image files and displaying them to appear small.

You can also find waste within the images, in the form of detail that doesn't need to be there. Removing detail by blurring out parts of an image, using photography with shallow depth of field, photographing objects on plain backgrounds, or using monochrome images are just a few ways to reduce image file sizes. If the detail isn't needed, then it's waste.

Even if you design images efficiently, there's still potential waste in the image files themselves. Using indexed color in your image editing application can strip out unnecessary data from image files with no visual loss of quality.

2. Choose your file format wisely

You can also use more efficient file formats. For example, WebP image files are typically 30% smaller than JPEG and AVIF image files are roughly half the size of JPEGs.

Vector graphics such as SVG can also be much more efficient alternatives to photography on websites. You can optimize your SVG files by stripping out unnecessary layers in the design files and simplifying vector paths. The size of an SVG file can be reduced as much as 97% simply by spending a few minutes cleaning up the design file.

3. Stop autoplaying video

Autoplay videos consume far more data and energy than other content types. New York Times journalist Brian Chen wrote an article about the scourge of autoplay videos on the web, stating that they "demand your attention while burning through your data plan and sucking up your batteries." They waste a user's data plan (and therefore their money), they waste energy, and they slow down web pages. Use video sparingly, and put a play button on it to allow users to opt in.

4. Zero waste fonts

System fonts might not be popular with designers, but they already exist on every user's device so they don't need to be loaded, making them truly zero waste. For example, a travel website might use a system font to deliver an efficient user experience for its users, many of whom may be abroad and using slow, expensive roaming data.

The font-family CSS property provides some generic family names you can use to designate fonts that are already installed on the host system:

  • serif
  • sans-serif
  • cursive
  • system-ui

If you do use web fonts, the easiest place to look for waste is to identify characters in the font file that your website doesn't use. For example, some fonts supply thousands of characters, yet the English language only needs about one hundred. There are a number of font subsetting tools available online that can take any font file and strip out characters not used in your target languages.

When selecting the font to use, a browser doesn't stop at the first font in your CSS list. Font selection is actually done for each character on the webpage under the assumption that when one font lacks a specific glyph, another font in your list might provide it. If you know you need a font for a set of special characters, add that font only after you've set the main font choice to a system font.

Just like images, you can save more data by using efficient file formats. WOFF2 font files can be about 30% smaller than WOFF files, and as much as 75% smaller than TTF files.

5. Find the waste in your code

The tool CSSstats.com allows you to visualize what is actually in your CSS files and see how often you duplicate the same styles. Seeing this waste can help you clean it up, and implementing a modular design language with repeatable styles can help you maintain clean, efficient CSS over the long term.

When choosing libraries, frameworks or tracking scripts, you should ask yourself whether they're really necessary, and whether smaller alternatives are available. For example, jQuery might only be 30kb, but it's possible to build an entire web page in less than 30kb. If you can avoid adding it, you should. Likewise, the basic Google Analytics tracking script is 17kb but an alternative like the open source Plausible analytics is less than 1kb and is designed to respect people's privacy.

Some programming languages are also more wasteful than others in terms of the energy efficiency with which they can perform tasks. JavaScript is seven times more energy efficient than PHP. You should keep this in mind when deciding what new languages to learn and what technologies to specify for future projects.

Reducing waste on the web is good for everyone

It's true that eliminating waste in our web projects requires a bit of extra attention to detail, but when you do so you can create web experiences that are not only better for the environment, but deliver faster, more accessible user experiences too. Who doesn't want that?

So perhaps you should ask yourself this question from Urban Ore: "If you're not for zero waste, how much waste are you for?"

Achieve zero waste web design with these open source tools and tips.

Image by:

Opensource.com

Web development Science What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Linux KDE receives first-ever eco-certification for Okular

opensource.com - Thu, 04/21/2022 - 15:00
Linux KDE receives first-ever eco-certification for Okular Seth Kenlon Thu, 04/21/2022 - 03:00 Up Register or Login to like.

The open source community KDE recently received the German Blue Angel (Blauer Engel) ecolabel for energy efficiency. The software, Okular, is a universal document viewer designed to work on multiple platforms with a wide variety of file formats.

As a longtime member of the KDE community and a happy Plasma Desktop user, I asked Joseph De Veaugh-Geiss of the KDE Eco group about the ways KDE and open source can help computing be eco-friendly.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles

Q: KDE has announced that sustainability is a top priority. People don't typically consider software a factor in contributing to physical waste, so what does it mean for an application to be eco-friendly?

Joseph De Veaugh-Geiss: Software can produce waste in many ways. Software that reduces this waste is software that is more sustainable. User autonomy and transparency, the pillars of Free and Open Source Software, are factors that the Blauer Engel ecolabel recognizes as critical for sustainable software.

I can illustrate with some examples.

A computer may be rendered hardly usable, or not usable at all, due to inefficient software design, feature creep, and other forms of software bloat that users may not need or even want. Yet vendors force users to buy newer, more powerful hardware. When updates for a device, like a mobile phone or tablet, are discontinued, most people discard the device as e-waste because continued use would be a security risk. This e-waste can have huge environmental costs.

According to a report in Anthropocene Magazine, the production of a smartphone accounts for 85% to 95% of its annual carbon footprint due to the energy-intensive processes required to mine the metals. Giving users autonomy in how their software runs, what is installed or uninstalled, which devices are supported, and so on is critical for reducing hardware waste.

Q: I imagine the way software interacts with hardware can also be inefficient. Does KDE take this into consideration?

Joseph De Veaugh-Geiss: Software can waste energy, which in turn drives up electricity bills and drains the battery. For example, advertisements or tracking data transmitted in the background are common causes of excess energy use. Users are usually powerless to opt out of such background computations, and in many cases these wasteful processes have nothing to do with the primary functions of the software.

Consider a report from the German Environment Agency, which found that two text editors performing the same task had drastically different energy demands: To get identical end results, one text editor consumed 4 times the energy compared to the other!

In probably every country in the world, every student, official, and everyday user uses a text editor. If you increase software efficiency by 4 times for billions of users worldwide, the numbers quickly add up. Choosing the more energy-efficient text editor would mean nontrivial energy savings, but transparency about software's energy demands is necessary to make such choices.

KDE Eco views eco-friendliness in terms of a range of factors that reduce waste and increase sustainability. The Blue Angel award criteria for software, which is a focus of the Blauer Engel 4 FOSS (free/open source software) project, provides an excellent benchmark for evaluating the eco-friendliness of software.

Q: Is there a benefit to users for their software to be sustainable?

Joseph De Veaugh-Geiss: Both software that conserves energy by reducing unnecessary background processes and software that is more energy-efficient with identical results can lead to lower electricity bills, longer battery usage, extended hardware life, higher software responsiveness, and so on. And you can save money by continuing to use functioning hardware with up-to-date software.

Most important of all, using software that is sustainable may reduce the environmental impact of digitization and contribute to more responsible use of shared resources.

Q: When programming, what things can a developer keep in mind to make their code sustainable?

Joseph De Veaugh-Geiss: I'm not a coder, but measuring energy consumption is an important first step in achieving more sustainable software. Once the numbers are known, developers can drive down the code's energy demands on hardware. This is why KDE Eco is working on setting up a community measurement lab to make measuring energy consumption accessible to FOSS projects.

The SoftAWERE project from the Sustainable Digital Infrastructure Alliance, which KDE Eco has been collaborating with, is looking to make energy consumption measurements part of the CI/CD pipeline. These tools help developers make their code more sustainable.

Q: Have you had to make trade-offs when programming Okular to make it more sustainable? In other words, have you had to sacrifice quality or features for sustainability?

Joseph De Veaugh-Geiss: In terms of the Blue Angel ecolabel, with its emphasis on transparency in energy and resource consumption and user autonomy, Okular was already quite close to compliance.

Most of the work was in measuring the energy and hardware demands when using Okular and analyzing the results—carried out by researchers at Umwelt Campus Birkenfeld—as well as documentation of fulfillment of the award criteria. In some cases, we lacked documentation simply because we in the FOSS community may take many aspects of user autonomy for granted, such as freedom from advertising, uninstallability, or having continuous updates provided free of charge. In this respect, there was no sacrifice in quality or features of the software, and in some cases we now have better documentation after completing the application for eco-certification.

We will see what the future brings, however: In order to remain compliant, the energy demand of Okular must not increase more than 10% compared to the value at the time of application. It is possible this could require trade-offs at a future date. Or not!

Q: The Plasma Desktop isn't generally considered a lightweight desktop, especially when compared to something like LXQt. If an aging computer can't handle the full desktop, can I still benefit from K apps such as Okular?

Joseph De Veaugh-Geiss: Yes, I believe there is a benefit to using Okular and other KDE apps over less efficient alternatives regardless of the desktop.

Q: Why do you think Okular got the attention of the Blue Angel project instead of other KDE applications like Gwenview, Dolphin, Elisa, and so on?

Joseph De Veaugh-Geiss: Everybody needs a PDF and general document viewer! And Okular is multiplatform software, with downloads available for GNU/Linux, Plasma Mobile, Android, and Windows. This made Okular an attractive candidate for a Blue Angel application.

Please keep in mind, however, that we are working on certifying other KDE software in the near future. We already have energy consumption measurements for KMail and Krita, thanks to the work of the Umwelt Campus Birkenfeld, and we are preparing to measure Kate and GCompris in our coming community lab at KDAB (Klaralvdalens Datakonsult AB) Berlin. Moreover, we have begun reaching out to the wider FOSS community regarding measuring and improving energy efficiency and possible Blue Angel eco-certification.

Q: How important is open source to the idea of sustainable computing?

Joseph De Veaugh-Geiss: Free and open source software can promote transparency and give users control over the software they use, rather than companies or device manufacturers. This means users, and their communities, can directly influence the factors that contribute to sustainable software design, whether when using the software or developing it.

Q: What are your future plans for KDE Eco?

Joseph De Veaugh-Geiss: In the coming weeks, we will set up the first community lab at KDAB Berlin for measuring the energy consumption of Free Software. Once the lab is set up, we will have a measure-athon to measure Kate, GCompris, and other Free Software applications. We plan to publish the results, and over time we hope to push more and more developers, FOSS or otherwise, to be transparent about the energy demands of their software products.

With more software measured, we hope to attract developers to help us develop tools to make energy consumption measurements more accessible. For instance, there is a great data analysis tool—OSCAR (Open source Software Consumption Analysis in R)—but it will need maintenance. Perhaps there are other data analysis tools we could develop for this work. Moreover, our long-term vision for the lab is to have an upload portal where developers can upload their software and usage scenarios, and the entire measurement and data analysis process is automated.

We look forward to working with the FOSS community to make these kinds of toolsets a reality!

The open source document viewer is just one element of KDE's initiative to make software more sustainable.

Image by:

(Image by KDE.org)

Linux Science What to read next Why I love KDE for my Linux desktop This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How Linux rescues slow computers (and the planet)

opensource.com - Thu, 04/21/2022 - 15:00
How Linux rescues slow computers (and the planet) David Both Thu, 04/21/2022 - 03:00 Up Register or Login to like.

Mint and Kasen, two of my grandkids, asked me to help them build gaming computers. I am ecstatic that they asked. This gives me a great opportunity to help them learn about technology while being a part of their lives. Both of those things make me happy. There are many ways to approach the ecological impact of computers.

Wait! That's quite a non-sequitur—right? Not really, and this article is all about that.

What happens to old computers?

What happens to old computers (and why) is a big part of this discussion. Start with the typical computer getting replaced after about five years of service. Why?

Online articles such as this one I found on CHRON, a publication aimed at small businesses suggest a three-to-five-year lifespan for computers. This is partly based on the alleged fact that computers slow down around that time in their life cycle. I find the pressure to get a newer, faster computer within that same time frame in this and other articles. Of course, much of that pressure comes from the computer and chip vendors who need to keep their income streams growing.

The United States Internal Revenue Service reinforces this five-year service life by specifying that time frame for full depreciation of computers.

Let's start with the myth of computer slowdowns. Computers don't slow down—ever. Computers always run at their designed clock speeds. Whether that is 2.8GHz or 4.5GHz, they will always run at that speed when busy. Of course, the clock speeds get intentionally reduced when the computer has little or nothing to do, saving power.

Computers don't slow down because they are old. Computers with Windows installed produce less legitimate work as they grow older because of the massive amount of malware, spyware, adware, and scareware they accumulate over time. Computer users have come to believe that this is normal, and they resign themselves to life with all of this junk dragging down the performance of their computers.

More Linux resources

Linux to the rescue

As a known computer geek among my friends and acquaintances, people sometimes gift me with their old computers. They no longer want them because they are slow, so they give them to me and ask me to wipe their hard drives before taking them to the electronics recycling center a few blocks from my house. I always suggest that their three-to-five-year-old computers are still good, but they seem intent on spending money rather than learning a new operating system.

I have several old computers gifted to me. One, in particular, a Dell Optiplex 755 with a 2.33 GHz Core 2 Duo processor and 8GB of RAM, is particularly interesting. Its BIOS is dated 2010, so it is around 12 years old. It is the oldest computer I have, and I keep it quite busy. I have had it for several years, and it never slows down because I use Linux on it—Fedora 35 right now.

If that is an exception, here are more. I built three computers for myself in 2012, ten years ago, and installed Fedora on all of them. They are all still running with no problems and as fast as they ever did.

There are no exceptions here, just normal operations for old computers on Linux.

Using Linux will at least double the usable lifetime of a computer and at no cost. This keeps those computers out of the landfill (at worst) and out of the recycling centers (at best) for an additional five-to-seven years or more.

So long as I can find replacement parts for these computers, I can keep them running and out of any disposal or recycling path. The problem with some computers is finding parts.

Non-standard hardware

Let's talk about non-standard hardware and some of the computers that you can buy from some well-known companies. As I mentioned above, one of my old computers is a Dell. Dell is a respectable company that has been around for a long time. I will never purchase a Dell desktop or tower computer, although I will take them as donations or gifts. I can install Linux, get rid of Windows, and make these old computers useful again. I use them in my home lab as test computers, among other things.

However, Dell uses some non-standard parts that you can't easily replace. When you can find parts (like power supplies and motherboards), they are not cheap. The reason is that those vendors create systems with non-standard power supplies and motherboards that only fit within their own non-standard cases. This is a strategy used to keep revenues up. If you can't find these parts on the open market, you must go to the original manufacturer and pay inflated, if not exorbitant, prices.

As one example, the Dell Optiplex I have uses a motherboard, case, and power supply that do not meet generally accepted standards for physical compatibility. In other words, a Dell motherboard or power supply would not fit in a standard case that I can purchase at the local computer store or Amazon. Those parts would not fit in a gaming case that my grandkids would use. The holes for mounting the motherboard and power supply would not align. The power supply would not fit the space available in the standard case. The PCI card slots and back panel connectors on the motherboard would be in the wrong place for a standard case, and the power supply connectors would not match those on a standard motherboard.

Eventually, one or more of those non-standard parts will fail, and you won't be able to find a replacement at all, or at least not for a reasonable price. At that point, it makes sense to dispose of the old computer and purchase a new one.

Standard builds

Let's explore what using standardized parts can do for building computers, their longevity, and how that applies to the gaming computers that I am helping my grandkids with.

Most motherboards are standardized. They have standard forms such as micro ATX, ATX, and extended ATX. All of these have mounting holes in standard locations. Many of the locations overlap, so holes for ATX motherboards align with many of the mounting holes used on extended ATX motherboards. This means that you can always use a case that has holes drilled for standard motherboard hole locations for any of those motherboards. These motherboards have standard power connectors, which means you can use them with any standard power supply.

I sent both of my grandkids a gaming computer case that has standardized mounting holes for the motherboards for their birthdays. These holes have standard threads so that they can use the brass standoffs that come with any motherboard in those motherboard mounting holes. The standoffs screw into the motherboard, and themselves have standard threaded holes that fit standard motherboard mounting screws.

The result of all this is that they can install any standard motherboard in any standard case using standard fasteners with any standard power supply.

Note that memory, processors, and add-in cards are all standardized, but they must be compatible with the motherboard. So memory for an old motherboard may no longer be available. You would need a new motherboard, memory, and processor in such a case. But the rest of the computer is still perfectly good.

As I have told Mint and Kasen, building (or purchasing) a computer with standard parts means never having to buy a new computer. The good case I gave them will never need replacement. Over time components may fail, but they only need to replace any defective parts. This continuous renewal of standardized parts will allow those computers to last a lifetime with minimal cost. If one component fails, just replace that one part and recycle the defective one.

This also significantly reduces the amount of material you need to recycle or otherwise add to the landfills.

Recycling old computer parts

I am fortunate to live in a place that provides curbside recycling pickup. Although that curbside pickup does not include electronic devices, multiple locations around the area do take electronics for recycling, and I live close to one. I have taken many loads of old, unusable electronics to that recycling center, including my computers' defective parts. But never an entire computer.

I collect those defective parts in old cardboard boxes, sorted by type—electronics in one, metal in another, batteries in a third, and so on. This corresponds to the collection points at the recycling center. When a box or two get full, I take them for recycling.

Some final thoughts

Even after a good deal of research for this article and my own edification in the past, it is very difficult to determine where the recycled computers and computer parts will go. The website for our recycling center indicates that the outcomes for each type of recycled material get based on its economic value. Computers have relatively large amounts of valuable metals and rare earth elements, so they get recycled.

The issue of whether such recycling gets performed in ways that are healthy for the people involved and the planet itself is another story. So far, I have been unable to determine where electronics destined for recycling go from here. I have decided that I need to do my part while working to ensure the rest of the recycling chain gets set up and functions appropriately.

The best option for the planet is to keep computers running as long as possible. Replacing only defective components as they go bad can keep a computer running for years longer than the currently accepted lifespan and significantly reduces the amount of electronic waste that we dump in landfills or that needs recycling.

And, of course, use Linux so your computers won't slow down.

Don't throw away your old computer. Skip the landfill and revive it with Linux.

Image by:

Opensource.com

Linux Hardware Science What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Zink OpenGL-On-Vulkan Making Progress On Windows, X-Plane Looking To Use It

Phoronix - Thu, 04/21/2022 - 07:36
There is some exciting progress around Zink as the OpenGL 4.6 implementation built atop Vulkan APIs for generally quite performant OpenGL-on-Vulkan acceleration... Zink with the recently-merged Kopper code is even beginning to work on Windows and Laminar Research is hoping to use Zink for the next major X-Plane release!..

Experimental "FineIBT" Series Published For Linux - Building Atop Intel CET/IBT

Phoronix - Thu, 04/21/2022 - 02:00
Merged as part of Linux 5.18 is Intel's Indirect Branch Tracking (IBT) support as part of CET (Control Flow Enforcement) technology. Indirect Branch Tracking is intended to help protect against JUMP/CALL oriented attacks as part of CET's control-flow integrity protections. Meanwhile still being worked on is "FineIBT" as a more compiler-hardened version built atop Intel CET/IBT...

Pages