<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: GryphonYang</title>
    <description>The latest articles on DEV Community by GryphonYang (@gryphonyang).</description>
    <link>https://dev.to/gryphonyang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4268427%2F639a97ed-78da-4740-945f-3762fc1bb666.jpg</url>
      <title>DEV Community: GryphonYang</title>
      <link>https://dev.to/gryphonyang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gryphonyang"/>
    <language>en</language>
    <item>
      <title>Running LibRaw, WebGL2 Color Grading, and Memory-Bounded Video Reversal in a Browser Tab (Zero Uploads)</title>
      <dc:creator>GryphonYang</dc:creator>
      <pubDate>Fri, 27 Nov 2026 09:01:41 +0000</pubDate>
      <link>https://dev.to/gryphonyang/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-29kf</link>
      <guid>https://dev.to/gryphonyang/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-29kf</guid>
      <description>&lt;p&gt;Every "free online RAW converter" or "online video cutter" follows the same playbook: upload your 40 MB Sony &lt;code&gt;.ARW&lt;/code&gt; or 4 GB action-camera &lt;code&gt;.MP4&lt;/code&gt; to a remote bucket, wait in a server queue, and hope the output doesn't come back with a watermark or heavy recompression.&lt;/p&gt;

&lt;p&gt;When you come back from a shoot with hundreds of camera RAWs and multi-gigabyte 4K clips, uploading gigabytes of personal footage just to cull keepers, grade colors, or trim a few clean subclips makes no sense. Modern browsers already ship WebAssembly SIMD, WebGL2 3D textures, WebCodecs, and Worker threads.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://cutcull.com" rel="noopener noreferrer"&gt;CutCull&lt;/a&gt;&lt;/strong&gt; — a free, watermark-free, zero-upload RAW photo developer and multi-subclip video trimmer that runs entirely inside a browser tab (as the instant-access web companion to our upcoming native macOS/Windows desktop culling app). Your original files never leave your device.&lt;/p&gt;

&lt;p&gt;Here are the three core engineering problems we solved to make real sensor-level RAW development, real-time WebGL2 color grading, and multi-gigabyte video processing fast and stable inside browser memory limits.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Real Sensor Demosaicing for 20 Camera RAW Formats (Not Embedded JPEG Extraction)
&lt;/h2&gt;

&lt;p&gt;Most lightweight browser "RAW viewers" cheat: they scan the file header for the embedded preview JPEG that cameras write for their rear LCD screen, extract that 1600px 8-bit preview, and call it a conversion. The moment you push shadows or recover bright sunset highlights, 8-bit banding falls apart.&lt;/p&gt;

&lt;p&gt;To do genuine sensor-level RAW development in the browser, we compiled &lt;strong&gt;LibRaw&lt;/strong&gt; plus the &lt;strong&gt;GoPro GPR SDK&lt;/strong&gt; (for VC-5 compressed &lt;code&gt;.GPR&lt;/code&gt; RAWs) to WebAssembly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;20 camera-tested RAW extensions&lt;/strong&gt;: Sony &lt;code&gt;.ARW&lt;/code&gt;, Canon &lt;code&gt;.CR3&lt;/code&gt; / &lt;code&gt;.CR2&lt;/code&gt; / &lt;code&gt;.CRW&lt;/code&gt;, Nikon &lt;code&gt;.NEF&lt;/code&gt; / &lt;code&gt;.NRW&lt;/code&gt;, Fujifilm &lt;code&gt;.RAF&lt;/code&gt; (X-Trans &amp;amp; Bayer), DNG &lt;code&gt;.DNG&lt;/code&gt; (DJI, Leica, Ricoh, phones), OM System / Olympus &lt;code&gt;.ORF&lt;/code&gt; / &lt;code&gt;.ORI&lt;/code&gt;, Panasonic &lt;code&gt;.RW2&lt;/code&gt;, Leica &lt;code&gt;.RWL&lt;/code&gt;, Hasselblad &lt;code&gt;.3FR&lt;/code&gt; / &lt;code&gt;.FFF&lt;/code&gt;, Phase One &lt;code&gt;.IIQ&lt;/code&gt;, Pentax &lt;code&gt;.PEF&lt;/code&gt;, Samsung &lt;code&gt;.SRW&lt;/code&gt;, Minolta &lt;code&gt;.MRW&lt;/code&gt;, GoPro &lt;code&gt;.GPR&lt;/code&gt;, and Sigma &lt;code&gt;.X3F&lt;/code&gt; (plus batch &lt;code&gt;.HEIC&lt;/code&gt; conversion).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worker isolation&lt;/strong&gt;: Demosaicing a 45–60 MP Bayer or X-Trans sensor buffer takes hundreds of milliseconds of CPU work. Running the WASM decoder inside a dedicated Web Worker keeps UI scrubbing, filmstrip navigation, and slider drags responsive at 60 fps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch export without opening every file&lt;/strong&gt;: If you drop 20 &lt;code&gt;.CR3&lt;/code&gt; or &lt;code&gt;.ARW&lt;/code&gt; files into the workspace, grade three hero shots, and hit batch export, unedited RAWs automatically decode and export at full sensor resolution (JPG quality 90 or lossless PNG) alongside your graded picks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj174p4fqy82bkza4o50n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj174p4fqy82bkza4o50n.jpg" alt="CutCull browser RAW develop workspace showing Sony ARW decoding, Kelvin white balance, tone sliders, and 3D .cube LUT controls" width="799" height="409"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Shared Rust Color Math &amp;amp; a Single-Pass WebGL2 Grading Shader
&lt;/h2&gt;

&lt;p&gt;Once demosaiced wide-gamut pixels arrive from WASM, running pixel math on the CPU in JavaScript is far too slow for interactive sliders. At the same time, chaining half a dozen separate WebGL passes wastes memory bandwidth on high-megapixel photos and 4K HDR frames.&lt;/p&gt;

&lt;p&gt;We defined a single color math specification in Rust (&lt;code&gt;cutcull-core&lt;/code&gt;) mirrored by a &lt;strong&gt;single-pass WebGL2 fragment shader&lt;/strong&gt; in the browser (and matching export pipelines), so interactive preview and final export stay consistent across photos and video:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;As-Shot Anchored Kelvin White Balance&lt;/strong&gt;: Camera white balance coefficients from the RAW metadata anchor an intuitive &lt;strong&gt;Temperature (Kelvin)&lt;/strong&gt; and &lt;strong&gt;Tint&lt;/strong&gt; control alongside one-click &lt;strong&gt;Auto grade&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Highlight-Safe Tone &amp;amp; Presence Controls&lt;/strong&gt;: Interactive &lt;strong&gt;Exposure, Contrast, Highlights, Shadows, Whites, Blacks, Dehaze, Vibrance, and Saturation&lt;/strong&gt; math evaluated in linear/perceptual space within a single fragment pass, paired with non-destructive &lt;strong&gt;spatial aspect-ratio crop&lt;/strong&gt; (&lt;code&gt;Original&lt;/code&gt;, &lt;code&gt;Free&lt;/code&gt;, &lt;code&gt;16:9&lt;/code&gt;, and social presets).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware &lt;code&gt;sampler3D&lt;/code&gt; &lt;code&gt;.cube&lt;/code&gt; 3D LUTs&lt;/strong&gt;: Built-in creative looks (&lt;code&gt;Warm&lt;/code&gt;, &lt;code&gt;Cool&lt;/code&gt;, &lt;code&gt;Black &amp;amp; white&lt;/code&gt;, &lt;code&gt;Teal + orange&lt;/code&gt;) plus custom user &lt;strong&gt;&lt;code&gt;.cube&lt;/code&gt; 3D LUT&lt;/strong&gt; files uploaded into a WebGL2 3D texture for single-fetch hardware trilinear interpolation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consumer HDR Pipeline &amp;amp; Strict Local Privacy&lt;/strong&gt;: Preserves consumer &lt;strong&gt;HDR&lt;/strong&gt; (&lt;code&gt;HLG&lt;/code&gt; / &lt;code&gt;PQ&lt;/code&gt; 10-bit video and gain-map photos) end to end — while zero media bytes, filenames, custom LUTs, or edit parameters ever touch a network socket.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Multi-Subclip Stream-Copy Cutting &amp;amp; Windowed Video Reversal Without OOM
&lt;/h2&gt;

&lt;p&gt;Standard &lt;code&gt;ffmpeg.wasm&lt;/code&gt; demos usually read an entire video into in-memory &lt;code&gt;MEMFS&lt;/code&gt;, transcode it from start to finish, and crash the tab as soon as the input crosses a few hundred megabytes.&lt;/p&gt;

&lt;p&gt;For action-camera, drone, and vlog footage, we built two specialized local execution paths:&lt;/p&gt;

&lt;h3&gt;
  
  
  Instant Multi-Subclip Cutting (&lt;code&gt;-c:v copy&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Instead of a heavy multi-track NLE timeline, CutCull gives you &lt;code&gt;J / K / L&lt;/code&gt; shuttle keys and &lt;code&gt;I / O&lt;/code&gt; markers to tag &lt;strong&gt;multiple independent keeper ranges&lt;/strong&gt; on a single long source video, then exports every range as its own clean file via &lt;strong&gt;lossless stream copy&lt;/strong&gt; — no re-encoding, zero generation loss, and near-instant output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8fov8f8llk26l16ehqd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo8fov8f8llk26l16ehqd.jpg" alt="CutCull multi-subclip lossless video cutter workspace with I/O markers and subclip list" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory-Bounded Video Reversal
&lt;/h3&gt;

&lt;p&gt;Reversing a video (&lt;code&gt;vf=reverse,af=areverse&lt;/code&gt;) normally requires decoding every frame of the entire clip into uncompressed RAM at once — a 3-minute 1080p clip easily exceeds the 2–4 GB Wasm32 heap ceiling.&lt;/p&gt;

&lt;p&gt;To make longer 1080p clips reverse reliably in a browser tab, CutCull splits the job into &lt;strong&gt;2-second keyframe-aligned sliding windows&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decode only one short keyframe-bounded window into raw frames inside worker memory.&lt;/li&gt;
&lt;li&gt;Reverse video frames and audio samples for that window, encode the reversed segment, and immediately free the raw buffers.&lt;/li&gt;
&lt;li&gt;Concatenate the reversed segments seamlessly into a single MP4 download.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Peak memory stays flat whether your clip is 10 seconds or several minutes long. We pair this with pitch-preserving &lt;code&gt;0.1x–10x&lt;/code&gt; speed control and instant one-click audio track muting without video re-encoding.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It in Your Browser (No Sign-Up, No Watermark)
&lt;/h2&gt;

&lt;p&gt;You can drop a camera RAW photo (&lt;code&gt;.ARW&lt;/code&gt;, &lt;code&gt;.CR3&lt;/code&gt;, &lt;code&gt;.CR2&lt;/code&gt;, &lt;code&gt;.NEF&lt;/code&gt;, &lt;code&gt;.RAF&lt;/code&gt;, &lt;code&gt;.DNG&lt;/code&gt;, &lt;code&gt;.ORF&lt;/code&gt;, &lt;code&gt;.RW2&lt;/code&gt;, &lt;code&gt;.GPR&lt;/code&gt;, …), an iPhone &lt;code&gt;.HEIC&lt;/code&gt;, or an &lt;code&gt;.MP4&lt;/code&gt; / &lt;code&gt;.MOV&lt;/code&gt; clip directly into &lt;strong&gt;&lt;a href="https://cutcull.com" rel="noopener noreferrer"&gt;https://cutcull.com&lt;/a&gt;&lt;/strong&gt; — no account required, no watermarks, and zero uploads.&lt;/p&gt;

&lt;p&gt;We are also building the native &lt;strong&gt;macOS &amp;amp; Windows desktop edition&lt;/strong&gt; of CutCull for high-volume SD-card culling (hundreds to thousands of clips per shoot, Lightroom/Bridge-compatible &lt;code&gt;.xmp&lt;/code&gt; sidecars, and one-click FCPXML / Premiere XML / EDL handoff to DaVinci Resolve, Premiere Pro, and Final Cut Pro).&lt;/p&gt;

&lt;p&gt;If you work with WebAssembly media pipelines, WebGL2 color shaders, or camera RAW formats, I'd love to hear your feedback and edge cases!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webgl</category>
      <category>webassembly</category>
      <category>video</category>
    </item>
  </channel>
</rss>
