LDraw.org Discussion Forums
Img4Dat integrated in LDPC 1.7.7 - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Img4Dat integrated in LDPC 1.7.7 (/thread-29065.html)



Img4Dat integrated in LDPC 1.7.7 - Gabriel Läufer - 2025-09-10

Hi everyone,
Hi Nils,

To accelerate the sticker and pattern generation process, I’ve got another exciting news for you!

I’m partly referring to this thread: https://forums.ldraw.org/thread-23242.html on the LDraw forum. Mainly regarding the integration of Img4Dat in LDPC. 

I have no idea how many of you are still actively using the tool 'Img4Dat', or whether you're simply working with LDPC/LDPE from scratch for sticker and pattern generation.

However, I use Img4dat a lot and really enjoy it, even though it's still somewhat in a beta state. The source code and executable aren't publicly available, and the program is no longer actively maintained.

I’ve tried contacting Rolf Osterthun, the author of the program, via the LDraw forum and his webpage, but I haven’t received any reply so far. Therefore, I’ve decided to decompile Img4Dat in order to access the source code, open it up for future development, and integrate it into LDPC (see *note below).

Image 1.1 shows the decompiled Img4Dat program, including the source code opened in Visual Studio. Image 1.2 displays the re-compiled software running with a test image after path analysis. Although debugging is still in progress, the program is relatively stable and (almost) all features are functioning as intended.

   

Image 1.1: Decompiled source code from Img4Dat in Visual Studio

   

Image 1.2: Compiled program Img4Dat with test image after path analysis

Unfortunately Img4Dat was originally written in C#, whereas LDPC is written in VB. However, it's possible to combine C# and VB within the same Visual Studio solution (see Image 1.3). Mixing VB and C# isn’t the most elegant solution, but I suggest proceeding this way for now (see **note below).

   

Image 1.3: Img4Dat and LDPC 1.7.7 in one Visual Studio solution

Image 1.4 shows the compiled program running with the same test image as above, and the resulting pattern successfully imported into LDPC.

   

Image 1.4: Img4Dat integrated into LDPC.

At the moment, the program simply generates a *.DAT file, which is then loaded into LDPC. Again, this isn’t the cleanest workflow, but it’s functional for now and my current understanding of the structure of LDPC is simply not good enough to optimize it. I believe Niels could easily improve this process.

I’ve already (started) implementing several modifications on Img4Dat. The generated pattern will be projected onto the X/Y plane instead of the X/Z plane. Scaling will be based on LDU units rather than pixels, and all common image formats (.PNG, .JPEG, and .BMP) are supported for import. I’ve also updated the header file (replacing the reference to CCAL 2.0 by CCAL 4.0).

Currently, the pop-up dialog box is an exact copy of the original program, including the menu bar. However, all of this can be easily adapted now.

In case Niels is not willing to integrate the decompiled Img4Dat project into LDPC in a future release, we at least have an updated standalone version of Img4Dat, which can be further improved over time. Since it already runs independently, no additional work is required at this point.

What’s your take on this? Are you still actively using Img4Dat? Would you be interested in seeing it integrated with LDPC? Do you think I should move forward with the project? If there’s anything you’re missing or any feature you’d like to see added, feel free to let me know. I’d really appreciate your feedback!

@Nils: I could totally understand if you don't want to include the decompiled code, but I'm happy to help where I can if you do.

Thanks
Gabe

*I will not under any circumstances upload any code without permission form Rolf! If you are in contact with Rolf, please let me know or ask him for me instead. I will give him credit of course. 

**In the end, we would need conversion from C# to VB. It is possible but it will take a while, even with the help of KI. If we accept a combined VB/C# project we can already use it.


RE: Img4Dat integrated in LDPC 1.7.7 - Magnus Forsberg - 2025-09-10

I used Img4Dat when I made all patterns for the Muppet figures.

https://forums.ldraw.org/thread-27971-post-54468.html#pid54468

Would love to have it integrated in LDPC


RE: Img4Dat integrated in LDPC 1.7.7 - N. W. Perry - 2025-09-10

I've used Img4Dat quite a bit, and would love to see it continue to be developed/refined. On the other hand, I never adopted LDPC into my workflow, so at the moment a standalone version of Img4Dat would be of more interest to me.

The top thing on my wishlist right now for patterns would be SVG to LDraw conversion, and I think this was actually intended as a future capability for Img4Dat.


RE: Img4Dat integrated in LDPC 1.7.7 - Willy Tschager - 2025-09-11

(Yesterday, 21:40)Magnus Forsberg Wrote: Would love to have it integrated in LDPC

+1