JITCoS : Journal of Information Technology and Computer System
Vol. 2 No. 1 (2026): June

Web-Based Binary Image Compression Using Thresholding and Run-Length Encoding

Adli Rahman Harun Harahap (Universitas Islam Negeri Sumatera Utara)
Fazila Nazifa Edilia (Universitas Islam Negeri Sumatera Utara)
Andita Utami (Universitas Islam Negeri Sumatera Utara)
Zianah Nafisah Simbolon (Universitas Islam Negeri Sumatera Utara)
Faiz Akhtar Aqila (Universitas Malikussaleh)



Article Info

Publish Date
30 Jun 2026

Abstract

This study implements the Run-Length Encoding (RLE) algorithm for binary image compression in a web-based environment using thresholding as a preprocessing stage. The system was developed using JavaScript and the HTML5 Canvas API to perform grayscale conversion, thresholding, and image compression directly within a web browser. Thresholding was applied to transform RGB images into binary images with simpler and more repetitive pixel patterns suitable for RLE compression. The compression process encodes consecutive pixels with identical values into tuples consisting of run lengths and pixel values. Experiments were conducted using a test image and five threshold values (50,75,100,127,150) to evaluate their influence on compression performance. The results show that threshold selection affects pixel redundancy, the number of generated tuples, and compression efficiency. The highest performance was achieved at a threshold value of 127, resulting in storage savings of 63.6% and a compression ratio of 2.75:1. The findings indicate that RLE is effective for compressing binary images with repetitive pixel patterns. Furthermore, the RLE compression stage is lossless with respect to the binary image generated after thresholding, whereas the preprocessing stage from RGB to binary is lossy because color and intensity information are discarded.

Copyrights © 2026






Journal Info

Abbrev

jitcos

Publisher

Subject

Computer Science & IT Control & Systems Engineering

Description

JITCoS: Journal of Information Technology and Computer System is a peer-reviewed scholarly journal that aims to advance the theory and practice of information technology and computer systems. The journal seeks high-quality contributions from researchers, academics, and industry professionals that ...