DEV Community

hao jia profile picture

hao jia

404 bio not found

Joined Joined on 
When the matting answer key is a bigger model, a hair error of 54 measures the outline, not the strands

When the matting answer key is a bigger model, a hair error of 54 measures the outline, not the strands

Comments
4 min read
Round-trip PSNR sorted eight upscalers into tiers, then put EDSR in the GAN band

Round-trip PSNR sorted eight upscalers into tiers, then put EDSR in the GAN band

Comments
4 min read
My rowspan overflow check never fired, and a plain text search found the missing cell

My rowspan overflow check never fired, and a plain text search found the missing cell

Comments
4 min read
ONNX Runtime Web falls back from WebGPU to WASM silently, and the session won't say which ran

ONNX Runtime Web falls back from WebGPU to WASM silently, and the session won't say which ran

Comments
6 min read
A 10-second keyframe interval cut a screen recording by 75.6%, and seeks now decode 150 frames

A 10-second keyframe interval cut a screen recording by 75.6%, and seeks now decode 150 frames

Comments 1
4 min read
Estimating text height before OCR: connected components held up where projection didn't

Estimating text height before OCR: connected components held up where projection didn't

Comments
4 min read
Ghostscript /ebook resamples to 150 dpi and quietly converts images to sRGB

Ghostscript /ebook resamples to 150 dpi and quietly converts images to sRGB

Comments
4 min read
Pillow fades a P3 photo, sharp clips it: picking the JPEG default per target

Pillow fades a P3 photo, sharp clips it: picking the JPEG default per target

Comments
4 min read
On palette PNGs, oxipng's filter re-choice saved 15% on one photo and cost 1.6% on another

On palette PNGs, oxipng's filter re-choice saved 15% on one photo and cost 1.6% on another

Comments
4 min read
A 3x3 median cut my OCR errors from 11 to 2, then broke a half-size scan

A 3x3 median cut my OCR errors from 11 to 2, then broke a half-size scan

Comments
4 min read
On a 7 px trimap band, alpha matte MSE grows about 6x and SAD stays put

On a 7 px trimap band, alpha matte MSE grows about 6x and SAD stays put

Comments
4 min read
A small ffprobe check for which videos not to re-encode, and what it printed on five public clips

A small ffprobe check for which videos not to re-encode, and what it printed on five public clips

Comments
4 min read
Counting LZW codes to see why dithered GIFs come out bigger

Counting LZW codes to see why dithered GIFs come out bigger

Comments
4 min read
pdf.js render() resolves fine on a huge page, but the canvas reads back transparent

pdf.js render() resolves fine on a huge page, but the canvas reads back transparent

Comments
3 min read
Why getImageData returns different colors than putImageData wrote, at low alpha

Why getImageData returns different colors than putImageData wrote, at low alpha

Comments
4 min read
A bash loop that logs bytes and seconds for each PNG optimization step

A bash loop that logs bytes and seconds for each PNG optimization step

Comments
4 min read
Chromium turned my CFF OpenType font into Type 3 at every fsType value I tried

Chromium turned my CFF OpenType font into Type 3 at every fsType value I tried

Comments
3 min read
Alpha is just a plane in the pixel format, and FFmpeg drops it in three quiet places

Alpha is just a plane in the pixel format, and FFmpeg drops it in three quiet places

Comments
4 min read
Why 1-pass ABR landed under my target size: 60-second clip, x264, 25 and 10 MB

Why 1-pass ABR landed under my target size: 60-second clip, x264, 25 and 10 MB

Comments
3 min read
Estimating skew from OCR word boxes before row clustering: one of my three estimators broke at 5 degrees

Estimating skew from OCR word boxes before row clustering: one of my three estimators broke at 5 degrees

Comments
4 min read
Reading an image's matrix and clip from pdf.js getOperatorList: the last cm was enough until I nested one

Reading an image's matrix and clip from pdf.js getOperatorList: the last cm was enough until I nested one

Comments
4 min read
Where did the 254s go? A heatmap of non-255 pixels in a white JPEG

Where did the 254s go? A heatmap of non-255 pixels in a white JPEG

Comments
4 min read
Decode, draw, close, encode, save: one browser image loop, timed step by step

Decode, draw, close, encode, save: one browser image loop, timed step by step

Comments
4 min read
Computing a GIF's per-frame change box: one stray pixel keeps it at full canvas

Computing a GIF's per-frame change box: one stray pixel keeps it at full canvas

Comments
4 min read
How I put a number on the background-blur halo: luma difference in distance rings

How I put a number on the background-blur halo: luma difference in distance rings

Comments
4 min read
My WebCodecs encoder ladder for H.265: hardware hint first, a timed trial, H.264 as the floor

My WebCodecs encoder ladder for H.265: hardware hint first, a timed trial, H.264 as the floor

Comments
4 min read
I exported a long image at 300 DPI and got 175: the 16383-pixel ceiling

I exported a long image at 300 DPI and got 175: the 16383-pixel ceiling

Comments
3 min read
pdfsig said my edited signed PDF was still valid, so I compare ByteRange with the file size

pdfsig said my edited signed PDF was still valid, so I compare ByteRange with the file size

Comments
3 min read
Routing uploads to PNG-8 or WebP by content: the thumbnail, the fallback and the regression check

Routing uploads to PNG-8 or WebP by content: the thumbnail, the fallback and the regression check

Comments
5 min read
Multi-threaded AVIF encoding in the browser was 2-3x faster, until I raised the speed setting

Multi-threaded AVIF encoding in the browser was 2-3x faster, until I raised the speed setting

Comments
4 min read
FontFace loaded, check() said true, and my canvas still drew the fallback font

FontFace loaded, check() said true, and my canvas still drew the fallback font

Comments
4 min read
Dropping a VideoFrame is not closing it: 1,508 graphics buffers vs 12

Dropping a VideoFrame is not closing it: 1,508 graphics buffers vs 12

Comments
4 min read
Three ffmpeg one-liners that broke a portrait video, and the check that caught each one

Three ffmpeg one-liners that broke a portrait video, and the check that caught each one

Comments
4 min read
Mapping Word's srcRect crop to CSS and why center scaling drifts

Mapping Word's srcRect crop to CSS and why center scaling drifts

Comments
4 min read
The preview used my font, but the PDF's embedded font list didn't

The preview used my font, but the PDF's embedded font list didn't

Comments
5 min read
Measure ink and lighting before you binarize an image for OCR

Measure ink and lighting before you binarize an image for OCR

Comments 2
4 min read
256-colour PNGs can keep soft shadows. tRNS shows whether yours did

256-colour PNGs can keep soft shadows. tRNS shows whether yours did

1
Comments
5 min read
Detecting open passwords and permission locks in PDFs with pdf.js

Detecting open passwords and permission locks in PDFs with pdf.js

Comments
4 min read
A completed video seek did not always produce a new frame callback

A completed video seek did not always produce a new frame callback

Comments
3 min read
Testing MP4 delivery with identical media payloads and 200 or 206 responses

Testing MP4 delivery with identical media payloads and 200 or 206 responses

Comments
3 min read
Keep the original text when a PDF page falls back to OCR

Keep the original text when a PDF page falls back to OCR

Comments
4 min read
Reading a canvas back doubles its memory: numbers from three engines

Reading a canvas back doubles its memory: numbers from three engines

Comments
3 min read
My cutout PNG looked fine in canvas 2D and glowed in WebGL

My cutout PNG looked fine in canvas 2D and glowed in WebGL

Comments
3 min read
Decoding a progressive JPEG took 14 MiB more memory in my test

Decoding a progressive JPEG took 14 MiB more memory in my test

1
Comments
3 min read
Why red text blurs in canvas JPEG exports, and where 4:4:4 kicks in

Why red text blurs in canvas JPEG exports, and where 4:4:4 kicks in

Comments
5 min read
Compress-to-size in the browser: probe the quality floor before you bisect

Compress-to-size in the browser: probe the quality floor before you bisect

Comments
4 min read
onnxruntime-web numThreads silently falls back to 1 without COOP/COEP (6318 ms vs 2133 ms)

onnxruntime-web numThreads silently falls back to 1 without COOP/COEP (6318 ms vs 2133 ms)

1
Comments 1
3 min read
Ask the browser to decode HEIC before you ship a 510 KB WASM decoder

Ask the browser to decode HEIC before you ship a 510 KB WASM decoder

Comments 1
3 min read
canvas.toBlob ignores a string quality, and my first check for it was wrong

canvas.toBlob ignores a string quality, and my first check for it was wrong

Comments
3 min read
Your PDF export tool isn't the problem, your print CSS is

Your PDF export tool isn't the problem, your print CSS is

Comments
4 min read
I ship documents as one offline HTML file. Here is what I verify.

I ship documents as one offline HTML file. Here is what I verify.

Comments
5 min read
Measure the text, not the frame, when you compress a screen recording

Measure the text, not the frame, when you compress a screen recording

Comments
4 min read
The 4x upscale worked, and that was the problem: 30.7 MP, 41 MB, 38.7 s

The 4x upscale worked, and that was the problem: 30.7 MP, 41 MB, 38.7 s

Comments
4 min read
I replaced a docs-site GIF with animated WebP and it got bigger

I replaced a docs-site GIF with animated WebP and it got bigger

Comments
4 min read
A PDF is its own reference when you verify the images you pulled out of it

A PDF is its own reference when you verify the images you pulled out of it

Comments
4 min read
Our PDF upload limit says 2 MB. I tested auto-compression before adding it

Our PDF upload limit says 2 MB. I tested auto-compression before adding it

Comments
4 min read
Same 150 KB, three formats: what you actually get

Same 150 KB, three formats: what you actually get

Comments
4 min read
Your thumbnails look washed out: it's the ICC profile, not JPEG quality

Your thumbnails look washed out: it's the ICC profile, not JPEG quality

1
Comments 1
4 min read
Chrome fires onerror, WebKit shows it: feature-detect HEIC before you preview

Chrome fires onerror, WebKit shows it: feature-detect HEIC before you preview

Comments 1
4 min read
canPlayType said ‘probably’ in three engines; only two kept my transparent WebM transparent

canPlayType said ‘probably’ in three engines; only two kept my transparent WebM transparent

Comments
4 min read
loading...