MCPcopy Create free account
hub / github.com/arduinocelentano/cdimage

github.com/arduinocelentano/cdimage @v0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0 ↗ · + Follow
38 symbols 41 edges 9 files 7 documented · 18% updated 3y agov0.0 · 2022-07-22★ 68030 open issues

Browse by type

Functions 33 Types & classes 5
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cdimage

A tool for burning visible pictures on a compact disc surface

alt text

Project's Origins and Credits

I know of at least two successful attempts to implement a similar technique. One was accomplished about 15 years ago by argon Instructables user. Another attempt was made by a user with nickname [unDEFER] (no English documentation unfortunately). These two projects inspired me some time ago. And in fact my coordinate conversion code is mostly based on [unDEFER]’s implementation. I also used geometric parameters of some compact discs from that project. I acknowledge and am grateful to these developers for their contributions.

I played with color shades and different compact discs with moderate success and created a GUI with visual preview mode. I tried to implement a user-friendly solution but finally abandoned the project in 2008 due to a problem of calibration for every particular brand and type of compact disc. Recently I found my old code and decided to share it. More as a tribute to the compact disc era. But maybe you will make some use of it. I fixed some obvious bugs, brushed the code up a little and ported it to modern Qt6. I considered porting to Python but I still need C++ because audio track generation takes some time even on modern hardware.

Building

You'll need Qt 6 library to build it. Just run qmake and then make. Alternatively you could build the project with Qt Creator if you installed it.

Before you start

If your compact disc is not mentioned in the track generating dialog, you'll probably fail. All the discs are slightly different geometrically. This difference does not matter for data storage but dramatically influences image calculation. You could try to guess geometry of an unknown disc and input it manually, but you'll probably spoil a lot of discs before you get some results. Moreover, all your test discs should be perfectly identical or you should use the same CD-RW disc. Sometimes discs of the same model happen to have different parameters. Don't know why. After all, manufacturers have never cared since those discs were never supposed to be used this way.

Considering Calibration

From the Mathematical point of view we have a sort of multi-objective optimization problem. Bicriteria optimization, to be more precise. It means that two objective functions should be optimized simultaneously. If we define goal as getting a "neat image", we need an expert who is able to provide some feedback regarding image "quality". Which leads us to interactive methods.

The first and the most obvious idea is to select some series of equally spaced values for each criterium and burn a lot of discs with all possible combinations. If the space is narrow enough, you'll see something at some discs. Then narrow the range and repeat. A typical Computational Mathematics approach. A lot of iterations and time.

The number of iterations could be reduced if we gradually change criteria within one image from disc center to rim. Then one should look for areas where some distinctive fragments could be seen. The only implementation I know about was a part of CD PAINT project I mentioned. I thought it was gone, but finally found it. It was called defcdparams. Apparently CD PAINT project contributors used it to define geometry of four discs I know. However it is still a time consuming procedure. I think it was the main reason why CD PAINT project was abandoned.

At least for me it was the reason why I finally gave up. However I'd like to share some of my thoughts regarding possible improvements of calibration technique. The weakest component in the mentioned algorithm is the necessity of human expertise. How it could be automated?

  1. If all the discs are geometrically different, then seek time delays would be different to. Because the same sector A is located at different angles for two different discs. So if we know "ideal" delays for a calibrated disc, we theoretically should be able to calibrate another one. But... These delays must be optical drive dependent. So this solution potentially would face some hardware issues.

  2. I have not considered this option in 2008, but now we have more advanced image recognition algorithms and better cameras. So maybe some AI solution might be used instead of human expertise.

If you have other ideas, please share them.

Further readings

Probably the first implementation of similar technique.

The "Red Book" (CD-ROM ECMA standard).

Hackaday post about this project.

A project regarding optical drive reverse engineering. Not related directly to this project, but might be useful to give you a clue to how it probably could be done with hardware approach. Thanks to some guy for suggestion.

Core symbols most depended-on inside this repo

Shape

Method 32
Class 4
Enum 1
Function 1

Languages

C++100%

Modules by API surface

src/converter.h9 symbols
src/cdpreview.cpp8 symbols
src/converter.cpp7 symbols
src/mainwindow.cpp4 symbols
src/cdpreview.h4 symbols
src/createtrackdialog.cpp3 symbols
src/mainwindow.h1 symbols
src/main.cpp1 symbols
src/createtrackdialog.h1 symbols

For agents

$ claude mcp add cdimage \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page