Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why red ink vanishes under a red sheet, and how I made an iPhone do it

I work on Red Sheet at W Lab. Students in Japan write answers in red or orange pen, lay a sheet of red plastic over the page, and the answers disappear while the black questions stay. Slide the sheet down and you check yourself one line at a time. Red Sheet is an iPhone and iPad app that does this to a photo of your own notebook. This post is about the engine that finds the ink and hides it. Why…

The Red Sheet app on iPhone and iPad allows users to conceal handwritten answers by placing a red overlay over their notebook pages. This clever trick relies on understanding how red plastic filters light and how different colors interact with it. Red plastic lets red light through while blocking other colors, causing white paper and red ink to appear red, while black ink remains unaffected. Green highlighters, however, reflect almost no red light, appearing nearly black through the sheet and obscuring the text underneath.

Creating an iPhone app that replicates this effect requires more than just filtering the red channel from a photo. The app must accurately identify handwritten ink on various surfaces and lighting conditions. To achieve this, the app first adjusts for lighting by estimating the brightness of the paper background. It then separates ink from the paper using color analysis in the CIELAB color space, which better matches human perception.

Ink pixels are identified based on their distance from white and their chroma levels, while colored inks are clustered using k-means clustering to distinguish between different colors.

Next, the app distinguishes between handwritten pens and highlighters by analyzing their shapes. Pens are thin strokes with mostly empty bounding boxes, while highlighters are solid bands with mostly filled boxes. This shape-based classification ensures that pens are effectively hidden by the red overlay, while highlighters appear darker and block the text they cover.

The app then groups connected ink pixels into potential answers using a union-find algorithm and applies rules to identify individual answers based on their shape, size, and ink class.

Finally, the app renders the hidden ink on the screen. Hidden ink is masked and expanded to cover a slightly larger area, allowing the underlying paper color to show through and creating the illusion of erasure. The red overlay is applied last, completing the visual effect. This multi-step process works seamlessly on the iPhone, ensuring that answers remain hidden and intact until the user chooses to reveal them.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Security Audit Badges — What an Audit Covers, and What It Never Can

HostDeFi › Guides › Audit badges "Audited" is the most misread word in token marketing. It describes a code review with a date and a scope — not a background check on the people holding the keys.

  • Security audit badges do not guarantee audit credibility
  • Legitimate audit involves specific source files and graded findings
  • Badge legitimacy requires verification of auditor's website and contract addresses

My shop was invisible because of one line in robots.txt

I sell a small thing: a letter about a real place, written after walking it on Street View. One place, one walk, one letter to the person who asked for it. It costs about $1.20.

  • Shop invisible to search engines due to restrictive robots.txt file.
  • Owner discovered issue by testing robots.txt with Googlebot.
  • Suggested solution: move content to accessible host with place name in title.

Should code comments link to Stack Overflow answers? Let's argue about it

Scheduled broken-link and redirect checks that tell you the moment a link breaks — linkbruno.com Open any mature codebase and search for stackoverflow.com .

  • Code comments linking to Stack Overflow answers spark debate
  • Links aid future maintainers by providing attribution and context
  • Links can rot over time, becoming outdated or broken

Cutting out big product photos: mask resizing cost 1.5 of 255, the model cost 54

Picture a one-person shop with a few hundred product shots off a 24-megapixel camera and one weekend to cut them all out.

  • Resizing masks cost 1.5 out of 255, while model cost constant at 54
  • Heavy model resized 2048x2048 photo, mask quality dropped from 0.975 to 0.223
  • Resizing masks proved cheaper alternative than upscaling original images

Why Outer Wilds Bet on Unity: The Thesis Engine Behind a 22-Minute Solar System

Outer Wilds runs on Unity — Unity 2017 at launch, later Unity 2019 — not Unreal, not a custom C++ solar-system engine. That choice sounds boring until you see what tiny Mobius Digital asked it to do…

  • Outer Wilds uses Unity game engine for core development.
  • Unity offers cheap iteration and seamless platform transition.
  • Team adapted Unity's limitations to create a working solar system simulator.

More from Saturday 14 November →