SShortSingh.
Back to feed

Adjusting Image Brightness, Contrast and Saturation in the Browser Without Libraries

0
·4 views

CSS filters can handle basic visual effects, but pixel-level control requires the Canvas API and direct pixel manipulation. The article shows how to extract image data from a file using a canvas element. It explains per-channel brightness changes, the conversion of RGB values to HSL for saturation adjustments, and sharpness via a convolution kernel. It also notes that processing a large 4000×3000 image takes about 200ms, so previews can run at quarter resolution with full resolution reserved for download.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Six Common Causes of GBase 8s oninit Startup Failures and How to Diagnose Them

A guide explains why the GBase Database (GBase 8s) instance may fail to start when oninit -ivy is run, and suggests checking the environment before reinstalling. The six common causes covered include unset or incorrect ONCONFIG settings, port conflicts, directory permission problems, shared memory and system resource limits, and full disks. It also flags a missing or misconfigured sqlhosts file, which mainly affects client connectivity. For each cause, the article offers Linux commands to investigate, along with cautions against blindly killing processes, applying arbitrary memory values, or deleting files.

0
ProgrammingDEV Community ·

Directories Are Crowding Out Agency Pages in Search Results for Agency Queries

A live check of Google results for "content marketing agency" found seven of nine first-page results were listicles and directories rather than agency sites. Only two results were agencies' own pages, both regional service pages. The author argues buyers now find agencies through intermediaries, so agencies must compete to be listed. He recommends checking how many page-one results are directories, confirming that money pages are indexed in Search Console, and adding a GA4 segment for AI-referred traffic. The post comes from the author's own company, which builds a marketing-data tool, and he notes the same checks work with any analytics stack.

0
ProgrammingDEV Community ·

Five Common Causes of GBase 8s Connection Failures After Installation

A GBase Database (GBase 8s) instance can be running yet still refuse dbaccess or remote client connections. The guide lists five frequent culprits to check before reinstalling: sqlhosts misconfiguration, firewall restrictions, port conflicts, server name mismatches, and client connection settings. A typical sign is that local connections succeed while remote ones fail, often because the sqlhosts entry uses localhost or 127.0.0.1 instead of a reachable address. Administrators are advised to verify host addresses, test port reachability, and identify any process already using the database port without disabling firewalls or stopping unrelated services. The article recommends confirming server names and client configuration files before making changes.

0
ProgrammingDEV Community ·

Testing a Retro Text Generator Across Logo and Poster Use Cases

A text-image generator serves different creative goals, so a logo route and a poster route need distinct success criteria. The article argues that logo users need a compact identity asset that stays recognizable at small sizes, while poster users need a headline that reads clearly within a layout. It proposes a black-box test plan built on observable workflow stages such as text entry, preview, and download, without assuming anything about the product's internals. The author recommends a simple state vocabulary so bugs can be described and reproduced precisely, and suggests checking how previews hold up at several scales. The piece also cautions that automated checks can confirm a preview exists, but human review is still needed to judge letter legibility and cropping.