Jump to content
How to Install Plugins ×

Image To Code (AKA Image To C) Plugin


ShayEr

Recommended Posts

MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.x.

 

 

Hi,

This is an old school image-to-code addin for Paint.NET 3.0, it will take an image and will convert it to code.

From there you can compile the image into your code as data.

Currently only C/C++ is supported and not all the formats are tested.

In order to install it copy the dll into %ProgramFiles%\Paint.NET\FileTypes

Cheers.

 

Edited by toe_head2001
Link to comment
Share on other sites

I just tried it. Works pretty good.

Would you be able to make it so you could use this to output a PDN Palette file?

I have no programing experiance. That said, could you calculate the 96 most used colors in an image and then output them in HEX order to a .txt file?

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

How does it work?

It will just take the image and convert it to a C/C++ data structure.

What is the size limitation of the picture?

No size limitation, it will output array as big as you image.

What could we do with the code?

You can take the data structure as use it in your code, today most ppl can use resources to achieve that, but under some circumstances (embedded device for example) you can't and your only way to store gfx is using your code data segment.

Link to comment
Share on other sites

I just tried it. Works pretty good.

Would you be able to make it so you could use this to output a PDN Palette file?

I have no programing experiance. That said, could you calculate the 96 most used colors in an image and then output them in HEX order to a .txt file?

a. Palette has 256 color not 96.

b. In the near future I will add support for 8 bit palettized images.

Link to comment
Share on other sites

I just tried it. Works pretty good.

Would you be able to make it so you could use this to output a PDN Palette file?

I have no programing experiance. That said, could you calculate the 96 most used colors in an image and then output them in HEX order to a .txt file?

a. Palette has 256 color not 96.

b. In the near future I will add support for 8 bit palettized images.

ShayEr, that may be true, but a Paint.NET palette file only contains room for 96 colors.

Link to comment
Share on other sites

  • 5 years later...

(..) it will take an image and will convert it to code.

From there you can compile the image into your code as data.

It seems to do just what was promised. Surely it is the job of your code to manipulate and interpret the data structure, and not a Paint.NET plugin?

Link to comment
Share on other sites

  • 3 months later...
  • 3 years later...

Doesn't work with 4.0; any chance it can be updated?

This plugin is looking for PdnLib.dll, which hasn't been part of paint.net for ages. If I remember correctly, PdnLib.dll became PaintDotNet.Core.dll.

In paint.net v4, the aliasing of PdnLib.dll to PaintDotNet.Core.dll was removed, thus breaking compatibility with old plugins like this ones. So possibly, the only change required to make the plugin compatible, would be to swap out that assembly reference.

You could send an email directly to @ShayEr, and ask him to make that change. He provided his email address in the ReadMe.txt file.

 

Edit: Sorry, incorrect info.

Edited by toe_head2001

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

The PdnLib.dll -> PDN.Core.dll redirection is still there in the latest build. I haven't removed it.

 

You say "it doesn't work" but haven't provided any further details ...

  • Upvote 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

The PdnLib.dll -> PDN.Core.dll redirection is still there in the latest build. I haven't removed it.

Oh, my mistake. My faulty memory I guess. :/ 

 

My assumption was obviously wrong then, and the issue lies somewhere else.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...