Small-files: Difference between revisions

From XPUB & Lens-Based wiki
Line 36: Line 36:


* [https://github.com/lowtechmag/solar/wiki/Solar-Web-Design How to Build a Low-tech Website: Design Techniques and Process]
* [https://github.com/lowtechmag/solar/wiki/Solar-Web-Design How to Build a Low-tech Website: Design Techniques and Process]
* https://smolweb.org/
* https://codeberg.org/thgie/awesome-small-web-publishing


===Check the size of a web page===
===Check the size of a web page===

Revision as of 13:36, 10 April 2026

How to compress images?

What is data compression? It's a way to encode information in such way, that is uses less bytes to store it.

And if you are curious to learn how image files are encoded, have a look at the following links:

Image file types

Image resizing

Decrease the file size of an images by saving them with specific settings: quality, smoothing, progressive loading, no exif data, color sub-sampling. You can do this in Gimp, Imagemagick or Photoshop.

Dithering

How to compress audio?

Why compressing audio?

  • Which formats can be used on a web page?

The fancy and hard way

Uses FFmpeg. FFmpeg is a powerful, open-source tool for decoding, encoding, and manipulating multimedia files.

ffmpeg -i input.wav -b:a 128k output.mp3
  • the option "-i" is the input file
  • the option "-b:a" specifies the bit rate. its in kilobit per seconds. more bit less information is lost. possible option could be:
    • 96k
    • 112k
    • 128k
    • 160k
    • 192k
    • 256k
    • 320k
  • the last argument is the output file. with the format(.mp3) you define the compression format. options for audio would be:

The easy way

Use audacity :D

  1. Open the file with audacity
  2. Click on [File] -> [Export]
    1. Select [Export as MP3]
    2. Select [Export as OGG]
    3. Select [Export Audio ...] for opus
  3. In the new window that open you can select different format optins.
  4. select a name for the new file
  5. Click on [Save]

Further readings


How to compress video?

Which compression should be used should be used?

The fancy and hard way

ffmpeg -i input.mov -c:v libx264 -c:a aac -movflags +faststart  output.mp4
  • the option "-i" is the input file
  • the option "-c:v" is the video codec you use. in this case h264
  • the otpion "-c:a" is for the audio codec
  • the option "-movflags +faststart " is for web optimisation

The easy way

By using a software called HandBrake - The open source video transcoder

  • In HandBrake click on [Open source] and select the file you would like to transcode.
  • Select the preset.
  • For the web dont forget to select [Web optimized]

Further links


Keep your web pages light!

References

Check the size of a web page

Right-click on inspect and click on network.

Lazy loading

CSS sprites

Links

Small files as a feature

Command line tools

Discussion points

See also