barkbark00 Posted July 31, 2006 Share Posted July 31, 2006 In MSPaint you have the option to save bmp images in 256 and 16 colors. Is there be a way to make a converter in PdN to reduce the number of colors in a selected area (plug-in maybe)? this would make the image look similar to SearedIce's Cutout Effect http://paintdotnet.12.forumer.com/viewtopic.php?t=1100. Take responsibility for your own intelligence. 😉 -Rick Brewster Link to comment Share on other sites More sharing options...
RejZoR Posted July 31, 2006 Share Posted July 31, 2006 Hm, maybe it would be possible to use GIF dithering engine to do the color downsampling? Rick will know if it's possible... Link to comment Share on other sites More sharing options...
Illnab1024 Posted July 31, 2006 Share Posted July 31, 2006 int interval = 64; int R; int B; int G; int A; float divR; float divB; float divG; float divA; ColorBgra fin; void Render(Surface dst, Surface src, Rectangle rect) { for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { ColorBgra source = src[x, y]; divR = source.R/interval; divB = source.B/interval; divG = source.G/interval; divA = source.A/interval; R = (int)System.Math.Round(divR); B = (int)System.Math.Round(divB); G = (int)System.Math.Round(divG); A = (int)System.Math.Round(divA); R = R * interval; B = B * interval; G = G * interval; A = 255; //A * interval; fin.R = (byte)(R); fin.B = (byte)(; fin.G = (byte)(G); fin.A = (byte)(A); dst[x, y] = fin; } } } I love math. Explanation: a codelab script to make 256 colors without diffusion or dithering. Also, for 16 colors, change int interval = 64; to int interval = 128; . And yes, this can be simplified. I just don't feel like it. ~~ Link to comment Share on other sites More sharing options...
barkbark00 Posted July 31, 2006 Author Share Posted July 31, 2006 wow, that was quick!, I'll try it! EDIT:works great, just what i was looking for Take responsibility for your own intelligence. 😉 -Rick Brewster Link to comment Share on other sites More sharing options...
Illnab1024 Posted July 31, 2006 Share Posted July 31, 2006 Just making sure everyone knows, this will not save images as 256 color bmp. Glad to help. ~~ Link to comment Share on other sites More sharing options...
teotanato Posted July 31, 2006 Share Posted July 31, 2006 what are thoses codes?....never understood that =/ Link to comment Share on other sites More sharing options...
Mangix Posted July 31, 2006 Share Posted July 31, 2006 it's for a plugin called CodeLab. if you don't use CodeLab then don't worry about it. Link to comment Share on other sites More sharing options...
Illnab1024 Posted July 31, 2006 Share Posted July 31, 2006 I will be making a formatted plugin, so you know. _________________ This is my 300th post. ~~ Link to comment Share on other sites More sharing options...
teotanato Posted August 1, 2006 Share Posted August 1, 2006 i know it's code lab...the problem is that i dunno use it xD Link to comment Share on other sites More sharing options...
Born2killx Posted August 1, 2006 Share Posted August 1, 2006 copy and paste the code into the text box and it will automatically render the picture. I built my first computer at age 11! Link to comment Share on other sites More sharing options...
teotanato Posted August 1, 2006 Share Posted August 1, 2006 yeah that i know too....what i don REALLY KNOW is to make the codes =/ Link to comment Share on other sites More sharing options...
Illnab1024 Posted August 1, 2006 Share Posted August 1, 2006 You're on your own for learning C#. I don't know that much, myself. (I'm just used to javascript.) ~~ Link to comment Share on other sites More sharing options...
SweterdJ Posted October 10, 2009 Share Posted October 10, 2009 Big glad to help! Link to comment Share on other sites More sharing options...
jxp Posted October 10, 2009 Share Posted October 10, 2009 I have a low color file type plugin that supports saving images to 1bit, 4bit, 8bit and 16bit color depths. viewtopic.php?f=16&t=30638 Also without examining the code posted too much, does it do anything different to the Posterize effect (incuded in Paint.net)? I think setting each Posterize value to 8 (for Red, Green, Blue) will result in 256 possible colors Don't know what plugin to use? Try looking in the plugin gallery Link to comment Share on other sites More sharing options...
barkbark00 Posted October 11, 2009 Author Share Posted October 11, 2009 jxp, the original request predates the postertize plugin, but thank you for your helpful response. SweterdJ, this is a classic example of why necroposting is against the rules... Take responsibility for your own intelligence. 😉 -Rick Brewster Link to comment Share on other sites More sharing options...
Recommended Posts