Digitising CDs (a.k.a. using your phone as an image scanner)

23 JNRowe 15 7/28/2025, 4:47:46 AM hadess.net ↗

Comments (15)

dvh · 9h ago
I recently used ffmpeg to undo perspective from the image you just provide 4 corners coordinates and it produced straightened image:

    ffmpeg -i input.jpg -vf "perspective=x0=784:y0=396:x1=2396:y1=397:x2=684:y2=2479:x3=2610:y3=2467" output.jpg
voidUpdate · 9h ago
Is there anything FFMPEG cant do?
cadamsdotcom · 5h ago
I like the irony that LLMs, full of hidden capability, are so helpful for exposing the hidden capabilities of ffmpeg.
WesolyKubeczek · 4h ago
Hmm, I don’t even know where ImageMagick ends and ffmpeg begins anymore.
Igrom · 6h ago
There is photo scanning/camera software out there on phones that detects edges of documents/regions, then crops and deskews the image. My Xiaomi Redmi Turbo 3's camera app has a "document" mode that does that. I also know of other software (for example, Paperless Mobile — though it is not its primary feature) that does that.

I think this would be an improvement to the OP's process: Print a thick black rectangle sized such that the contour's inner edge is slightly larger than the CD. Use the phone to take a picture and deskew it - the scanner should "catch" on the inner contour. Repeat with all other CDs. Finally, load the images onto the computer and run batch processing on them using your raster image editor to trim whitespace. This way, you'd keep manual labour to a minimum.

MarioMan · 4h ago
It’s also stock on iOS, albeit buried in the Files app under More (3 dots in top right)>Scan Documents. It’s especially useful for multi-page documents.
techer · 4h ago
Less hidden in the stock Notes app. Paperclip/Scan Documents.
sandbach · 9h ago
I thought this was going to be about recovering data from a CD from just a photo of the shiny side. Could that be possible?
makeitdouble · 8h ago
CD data pitch would be 700nm, and it seems that camera sensors have a pixel pitch at the same order of magnitude.

Ignoring the lens resolution you'd need for a near 1 to 1 rendering at that size, any hand movement or misalignment would also be catastrophic.

That sounds like a crazy dream until we get to sensor in the peta pixel range ?

https://www.researchgate.net/figure/CD-DVD-Blu-ray-disc-data...

https://letmaik.github.io/pixelpitch/

No comments yet

schoen · 8h ago
I don't think so.

The total data on a CD-ROM including the error correcting redundancy exceeds 800 MB, or 6.4 Gb.

If you could imagine getting 1 bit from the optical disc per pixel (which is way too optimistic physically), you would need a 6 gigapixel camera focused super-precisely at the disc surface.

Looking at the problem from a different angle, Wikipedia says the features that store the data on the disc surface are about 800 nm (or about a micrometer) long. So to photograph them, you'd want to have pixels ideally smaller than a micrometer on each side. It's easy to check that an ordinary camera isn't achieving that kind of resolution without adding on external magnifying equipment.

jackweirdy · 8h ago
Does it have to be one photo? If you reproduced a spinning drive but with the camera positioned to see half of the spinning disc, I wonder if it could capture the "stream" of pixels in one arc of the spinning disc
schoen · 8h ago
You would still need some significant magnification. And there might also be a measurement latency issue if the disc is in motion (the camera CCD might not be fast enough to capture the image before it rotates away).

The optics of a CD-ROM drive are optimized for something pretty different than the optics of a camera. But if you made enough tweaks and adaptations, sure, the data is ultimately there and can be captured by a different kind of sensor than the one it was designed for. It would be a cool project.

I'm mostly just pointing out that adapting your camera to successfully capture billions of sub-micrometer features isn't that trivial.

easyThrowaway · 7h ago
I can't find the link, but there was a Stackoverflow question about ripping a cdrom by using a flatbed scanner, the conclusion was that the scanner would've required 2-3X the DPI currently available on a commercial device to correctly parse the gaps, given that a cdrom laser size is roughly 800nm.

On the other hand I'm still puzzled why there are no homebrew projects for a dumb dumping device that simply reads all the data on a cdrom, error correction, subchannels completely raw. There are a lot of CDs with a very weird data structure (Console Games, Early Copy Protected pc games, AKAI sample discs, some Hybrid Macintosh discs, in other words anything not using the iso9660 standard) which are at risk of Disc Rot[1], and simply storing them as Iso or Bin/Cue files (including proprietary variants like Alcohol 120%/Daemon Tools mdf files) is basically useless both for archival and real world usage purposes.

[1]https://en.wikipedia.org/wiki/Disc_rot

ralferoo · 4h ago
> On the other hand I'm still puzzled why there are no homebrew projects for a dumb dumping device that simply reads all the data on a cdrom, error correction, subchannels completely raw.

I think you'd have to write a custom firmware for one specific drive for that. That information is simply not exposed outside the device itself on standard drives, which is what makes it effective for copy protection.

lathiat · 2h ago
I'd say this project is the closest: https://github.com/superg/redumper

But is not a true raw dump like we see in a bunch of other media preservation projects.