Jump to content


Photo

Image To Code (AKA Image To C) Plugin


  • Please log in to reply
14 replies to this topic

#1 ShayEr

ShayEr
  • Newbies
  • 4 posts
  • Reputation:0

Posted 09 February 2007 - 03:50 PM

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.

#2 barkbark00

barkbark00
  • Members
  • 3,336 posts
  • Reputation:2

Posted 09 February 2007 - 04:25 PM

Is there any way to add the option to recompile the code as an image?

BTW...This is pretty cool!
Posted Image
Take responsibility for your own intelligence. ;) -Rick Brewster

#3 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:20

Posted 09 February 2007 - 04:32 PM

How does it work?
What is the size limitation of the picture?
What could we do with the code?

#4 barkbark00

barkbark00
  • Members
  • 3,336 posts
  • Reputation:2

Posted 09 February 2007 - 04:39 PM

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?
Posted Image
Take responsibility for your own intelligence. ;) -Rick Brewster

#5 ShayEr

ShayEr
  • Newbies
  • 4 posts
  • Reputation:0

Posted 10 February 2007 - 09:59 AM

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.

#6 ShayEr

ShayEr
  • Newbies
  • 4 posts
  • Reputation:0

Posted 10 February 2007 - 10:01 AM

Is there any way to add the option to recompile the code as an image?

BTW...This is pretty cool!


Sounds cool to implement, but currently this is a one way tool.

#7 ShayEr

ShayEr
  • Newbies
  • 4 posts
  • Reputation:0

Posted 10 February 2007 - 10:05 AM

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.

#8 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:20

Posted 10 February 2007 - 10:09 AM

Fine... It should be ok as well for C#.

Could you provide a short code example (C/C++)?

#9 BoltBait

BoltBait
  • Administrators
  • 8,910 posts
  • LocationCalifornia, USA
  • Reputation:103

Posted 11 February 2007 - 12:35 AM

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.
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#10 FriendlyFire

FriendlyFire
  • Newbies
  • 7 posts
  • Reputation:0

Posted 25 April 2012 - 11:58 PM

Anyone going to build on this great work?

#11 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,566 posts
  • LocationKirkland, WA
  • Reputation:120

Posted 26 April 2012 - 12:06 AM

And do what exactly
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#12 FriendlyFire

FriendlyFire
  • Newbies
  • 7 posts
  • Reputation:0

Posted 26 April 2012 - 01:14 AM

And do what exactly

Namely allow for text to be turned back into the image.

#13 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,635 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:221

Posted 26 April 2012 - 02:49 AM

(..) 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?

#14 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,566 posts
  • LocationKirkland, WA
  • Reputation:120

Posted 26 April 2012 - 06:23 AM

Namely allow for text to be turned back into the image.


You can already do that. Just add a block of code to save the image and run the modified program ... ?
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#15 sradforth

sradforth
  • Members
  • 15 posts
  • LocationGuildford, UK
  • Reputation:2

Posted 08 August 2012 - 11:14 AM

Have been thinking about paint.net needed one of these!! Absolutely perfect, great work!