The Serenity Operating System 🐞
Find a file
Nico Weber e2336e2099 LibGfx+animation: Only store changed pixels in animation frames
For example, for 7z7c.gif, we now store one 500x500 frame and then
a 94x78 frame at (196, 208) and a 91x78 frame at (198, 208).

This reduces how much data we have to store.

We currently store all pixels in the rect with changed pixels.
We could in the future store pixels that are equal in that rect
as transparent pixels. When inputs are gif files, this would
guaranteee that new frames only have at most 256 distinct colors
(since GIFs require that), which would help a future color indexing
transform. For now, we don't do that though.

The API I'm adding here is a bit ugly:

* WebPs can only store x/y offsets that are a multiple of 2. This
  currently leaks into the AnimationWriter base class.
  (Since we potentially have to make a webp frame 1 pixel wider
  and higher due to this, it's possible to have a frame that has
  <= 256 colors in a gif input but > 256 colors in the webp,
  if we do the technique above.)

* Every client writing animations has to have logic to track
  previous frames, decide which of the two functions to call, etc.

This also adds an opt-out flag to `animation`, because:

1. Some clients apparently assume the size of the last VP8L
   chunk is the size of the image
   (see https://github.com/discord/lilliput/issues/159).

2. Having incremental frames is good for filesize and for
   playing the animation start-to-end, but it makes it hard
   to extract arbitrary frames (have to extract all frames
   from start to target frame) -- but this is mean tto be a
   delivery codec, not an editing codec. It's also more vulnerable to
   corrupted bytes in the middle of the file -- but transport
   protocols are good these days.
   (It'd also be an idea to write a full frame every N frames.)

For https://giphy.com/gifs/XT9HMdwmpHqqOu1f1a (an 184K gif),
output webp size goes from 21M to 11M.

For 7z7c.gif (an 11K gif), output webp size goes from 2.1M to 775K.

(The webp image data still isn't compressed at all.)
2024-05-14 13:43:03 -04:00
.devcontainer Meta: Switch to clang-format-18 as the standard formatter 2024-04-24 16:50:01 -04:00
.github CI: Remove the Sonar Cloud and PVS Studio workflow 2024-05-11 15:43:18 -04:00
AK AK: Remove AK_HAS_CONDITIONALLY_TRIVIAL 2024-05-10 15:03:24 +00:00
Base Base: Add more emoji 2024-05-11 17:09:14 -06:00
Documentation CI: Remove the Sonar Cloud and PVS Studio workflow 2024-05-11 15:43:18 -04:00
Kernel Lagom: Add ClangPlugins to the build system 2024-05-13 16:50:54 -06:00
Ladybird Ladybird: Ensure hamburger menu is placed within the browser window 2024-05-08 10:39:46 +02:00
Meta LibGfx: Move AnimationWriter to its own file 2024-05-14 13:43:03 -04:00
Ports Ports/dosbox-staging: Enable mt32emu 2024-05-13 00:15:21 +02:00
Tests LibGfx+animation: Only store changed pixels in animation frames 2024-05-14 13:43:03 -04:00
Toolchain LibC: Remove libssp_nonshared.a 2024-05-07 16:39:17 -06:00
Userland LibGfx+animation: Only store changed pixels in animation frames 2024-05-14 13:43:03 -04:00
.clang-format
.clang-tidy Meta: Disable readability-function-cognitive-complexity in clang-tidy 2024-02-05 08:04:24 -07:00
.editorconfig
.gitattributes
.gitignore
.gn
.mailmap
.pre-commit-config.yaml
.prettierignore
.prettierrc
.ycm_extra_conf.py
CMakeLists.txt Lagom: Add ClangPlugins to the build system 2024-05-13 16:50:54 -06:00
CONTRIBUTING.md Meta+Documentation+Ports: Move from C++20 to C++23 2024-05-06 11:46:28 -06:00
flake.lock nix: Clean up files, use good practices 2024-03-25 14:19:34 -06:00
flake.nix nix: Clean up files, use good practices 2024-03-25 14:19:34 -06:00
LICENSE Meta: Update the year range in LICENSE 2024-01-06 17:39:16 -05:00
README.md CI: Remove the Sonar Cloud and PVS Studio workflow 2024-05-11 15:43:18 -04:00
SECURITY.md

SerenityOS and Ladybird

SerenityOS is a graphical Unix-like operating system for x86-64 computers.

Ladybird is a cross-platform independent web browser built from SerenityOS components.

GitHub Actions Status Fuzzing Status Discord

FAQ | Documentation | Build Instructions

About SerenityOS

SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.

Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.

You can watch videos of the system being developed on YouTube:

About Ladybird

Ladybird is a cross-platform independent web browser built from SerenityOS components. It is a separate project from SerenityOS, but it uses the SerenityOS build system and shares much of the same code. All the browser UI code lives in the Serenity repository under the Ladybird directory. The SerenityOS LibGUI port of Ladybird lives in the Userland/Applications/Browser directory. All the implementation details are in the Userland/Libraries and Userland/Services directories.

See the Ladybird README.md for more information.

SerenityOS Screenshot

Screenshot as of c03b788.png

SerenityOS Features

  • Modern x86 64-bit kernel with pre-emptive multi-threading
  • Browser with JavaScript, WebAssembly, and more (check the spec compliance for JS, CSS, and Wasm)
  • Security features (hardware protections, limited userland capabilities, W^X memory, pledge & unveil, (K)ASLR, OOM-resistance, web-content isolation, state-of-the-art TLS algorithms, ...)
  • System services (WindowServer, LoginServer, AudioServer, WebServer, RequestServer, CrashServer, ...) and modern IPC
  • Good POSIX compatibility (LibC, Shell, syscalls, signals, pseudoterminals, filesystem notifications, standard Unix utilities, ...)
  • POSIX-like virtual file systems (/proc, /dev, /sys, /tmp, ...) and ext2 file system
  • Network stack and applications with support for IPv4, TCP, UDP; DNS, HTTP, Gemini, IMAP, NTP
  • Profiling, debugging and other development tools (Kernel-supported profiling, CrashReporter, interactive GUI playground, HexEditor, HackStudio IDE for C++ and more)
  • Libraries for everything from cryptography to OpenGL, audio, JavaScript, GUI, playing chess, ...
  • Support for many common and uncommon file formats (PNG, JPEG, GIF, MP3, WAV, FLAC, ZIP, TAR, PDF, QOI, Gemini, ...)
  • Unified style and design philosophy, flexible theming system, custom (bitmap and vector) fonts
  • Games (Solitaire, Minesweeper, 2048, chess, Conway's Game of Life, ...) and demos (CatDog, Starfield, Eyes, mandelbrot set, WidgetGallery, ...)
  • Every-day GUI programs and utilities (Spreadsheet with JavaScript, TextEditor, Terminal, PixelPaint, various multimedia viewers and players, Mail, Assistant, Calculator, ...)

... and all of the above are right in this repository, no extra dependencies, built from-scratch by us :^)

Additionally, there are over three hundred ports of popular open-source software, including games, compilers, Unix tools, multimedia apps and more.

How do I read the documentation?

Man pages are available online at man.serenityos.org. These pages are generated from the Markdown source files in Base/usr/share/man and updated automatically.

When running SerenityOS you can use man for the terminal interface, or help for the GUI.

Code-related documentation can be found in the documentation folder.

How do I build and run this?

See the SerenityOS build instructions or the Ladybird build instructions.

The build system supports a cross-compilation build of SerenityOS from Linux, macOS, Windows (with WSL2) and many other *Nixes. The default build system commands will launch a QEMU instance running the OS with hardware or software virtualization enabled as supported.

Ladybird runs on the same platforms that can be the host for a cross build of SerenityOS and on SerenityOS itself.

Get in touch and participate!

Join our Discord server: SerenityOS Discord

Before opening an issue, please see the issue policy.

A general guide for contributing can be found in CONTRIBUTING.md.

Authors

And many more! See here for a full contributor list. The people listed above have landed more than 100 commits in the project. :^)

License

SerenityOS is licensed under a 2-clause BSD license.