Img4Dat


Img4Dat
#1
Hello,
 
long time ago I started implementing a tool to convert images to LDraw compatible .dat files. The first name was Img2Dat; but during the time the ‘version’ increased. Here is only a short description.
 
You can download the tool here (sorry, but I have to write this: the application, can be downloaded as it is. I do not take charge for errors or any kind of damage to your system that is caused by this software.): Img4Dat.zip
It is a beta version – there are some issues I that need an improvement. But I think it is stable enough for playing. It is written in C# for the .NET Framework 3.5 (so Windows).
 
If you open the application, you can open a bitmap (currently only .bmp) – it will be shown in the left half of the GUI.

.png   Clipboard01.png (Size: 144.44 KB / Downloads: 857)
 
Now you can choose colors for the color quantization by right click on the source image (select the background color first). The result will be shown in the right half of the GUI.
It is the base for the path findings (around the areas with the same color). After choosing the colors it is possible to clean the result a little bit (and to remove the obsolete areas in the background). 

.png   Clipboard02.png (Size: 204.78 KB / Downloads: 857)
You can save the result image to rework it in a different tool or just for backup.
You can search for the paths now, by clicking the 'FindPaths' button. The result will be shown on top of the original image.
Again, a little bit of cleaning can be done (here undo is possible):
  • Select one point and create a circle (with the connected points); you can define the number of points in the circle.
  • Select more then two points. The points will be projected on the line between the first and the last selected point.
  • Select more then three points. The points will be projected on a circle. The first and the last point will not change. You have to select the points in the right order.
  • Select two points. They will become one at the cut of the connected lines.
  • Select more then two points. The distance between this points will be recalculated. Here you also have to select the points in the right order.
  • When you have selected one point, you can delete it with pressing d-key.
  • When you have selected two points, you cann add a point between them by pressing the a-key.

.png   Clipboard03.png (Size: 190.53 KB / Downloads: 854)
You can also add a ‘template’ where the image should be patterned for, and scale and adjust it (currently only torso and tile 2x2 round).

.png   Clipboard04.png (Size: 196.46 KB / Downloads: 853)
When the result is fine, the triangles can be created by clicking the 'CreateTriangles' button  – a .dat file with the name of the source image becomes created in the folder of the source image. The colors need to be adjusted to LDraw colors.

.png   Clipboard05.png (Size: 4.13 KB / Downloads: 841)
(One hint: The triangle generation will not work correct, when two lines cross after cleaning the paths or adding the template.)

I would be happy, if someone gives it a try.

Rolf
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Img4Dat - by Rolf Osterthun - 2019-02-26, 23:11
RE: Img4Dat - by Philippe Hurbain - 2019-02-27, 16:02
RE: Img4Dat - by Rolf Osterthun - 2019-02-27, 16:44
RE: Img4Dat - by Philippe Hurbain - 2019-03-03, 9:17
RE: Img4Dat - by Rolf Osterthun - 2019-03-03, 14:25
RE: Img4Dat - by Rolf Osterthun - 2019-03-04, 21:36
RE: Img4Dat - by Philippe Hurbain - 2019-03-05, 9:07
RE: Img4Dat - by Rolf Osterthun - 2019-03-05, 10:57
RE: Img4Dat - by Philippe Hurbain - 2019-03-05, 11:55
RE: Img4Dat - by Rolf Osterthun - 2019-03-05, 12:49
RE: Img4Dat - by Philippe Hurbain - 2019-03-05, 13:40
RE: Img4Dat - by Philippe Hurbain - 2019-03-05, 15:54
RE: Img4Dat - by Philippe Hurbain - 2019-03-05, 18:20
RE: Img4Dat - by Rolf Osterthun - 2019-03-05, 19:13
RE: Img4Dat - by Philippe Hurbain - 2019-03-06, 12:41
RE: Img4Dat - by Rolf Osterthun - 2019-03-06, 20:45
RE: Img4Dat - by Philippe Hurbain - 2019-03-06, 16:56
RE: Img4Dat - by Philippe Hurbain - 2019-03-09, 8:27
RE: Img4Dat - by Rolf Osterthun - 2019-03-09, 14:07
RE: Img4Dat - by Philippe Hurbain - 2019-03-09, 15:09
RE: Img4Dat - by Philippe Hurbain - 2019-03-10, 14:25
RE: Img4Dat - by Rolf Osterthun - 2019-03-21, 23:05
RE: Img4Dat - by Philippe Hurbain - 2019-03-22, 8:54
RE: Img4Dat - by Rolf Osterthun - 2019-03-22, 10:17
RE: Img4Dat - by Philippe Hurbain - 2019-03-22, 11:56
RE: Img4Dat - by Philippe Hurbain - 2019-03-22, 18:15
RE: Img4Dat - by Philippe Hurbain - 2019-03-24, 15:32
RE: Img4Dat - by Rolf Osterthun - 2019-03-28, 21:25
RE: Img4Dat - by Philippe Hurbain - 2019-03-29, 15:17
RE: Img4Dat - by Johann Eisner - 2019-04-06, 19:01
RE: Img4Dat - by Rolf Osterthun - 2019-04-06, 21:09
RE: Img4Dat - by Johann Eisner - 2019-04-07, 8:07
RE: Img4Dat - by Gerald Lasser - 2019-06-25, 20:45
RE: Img4Dat - by Gerald Lasser - 2019-06-26, 20:55
RE: Img4Dat - by Rolf Osterthun - 2019-06-27, 21:17
RE: Img4Dat - by Gerald Lasser - 2019-06-28, 18:13
RE: Img4Dat - by Rolf Osterthun - 2019-07-04, 21:03
RE: Img4Dat - by Philippe Hurbain - 2019-12-04, 14:21
RE: Img4Dat - by Johann Eisner - 2019-12-08, 15:02
RE: Img4Dat - by Nils Schmidt - 2019-12-09, 11:22
RE: Img4Dat - by Rolf Osterthun - 2019-12-11, 23:11
RE: Img4Dat - by Philippe Hurbain - 2019-12-12, 12:34
RE: Img4Dat - by Rolf Osterthun - 2019-12-19, 17:24
RE: Img4Dat - by Philippe Hurbain - 2019-12-19, 19:13
RE: Img4Dat - by Vincent Messenet - 2019-07-28, 12:03
RE: Img4Dat - by Gerald Lasser - 2019-07-28, 12:59
RE: Img4Dat - by Philippe Hurbain - 2019-07-28, 13:05
RE: Img4Dat - by Vincent Messenet - 2019-07-28, 14:05
RE: Img4Dat - by N. W. Perry - 2020-05-14, 17:20
RE: Img4Dat - by CJ H. - 2020-08-23, 4:03
RE: Img4Dat - by Rolf Osterthun - 2020-09-08, 7:57
RE: Img4Dat - by N. W. Perry - 2020-09-08, 23:10
RE: Img4Dat - by Vincent Messenet - 2022-05-23, 13:41
RE: Img4Dat - by Philippe Hurbain - 2022-05-23, 14:20
RE: Img4Dat - by Vincent Messenet - 2022-05-23, 15:49
RE: Img4Dat - by N. W. Perry - 2022-07-23, 16:06

Forum Jump:


Users browsing this thread: 1 Guest(s)