APShredder Posted August 29, 2009 Share Posted August 29, 2009 The title pretty much says it all. Can you select random pixels from an image? The reason I'm asking is because I'm working on a plugin that dissolves one image onto another. I got it working with a lot of help from Simon Brown, but I'm not really satisfied with the effect it gives. So if it is possible, could you please post an example on what I should do. Thanks in advance. Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
Simon Brown Posted August 29, 2009 Share Posted August 29, 2009 By "select" do you mean actually modifying the selection, or just selectively using? Quote Link to comment Share on other sites More sharing options...
APShredder Posted August 29, 2009 Author Share Posted August 29, 2009 Just selectively using them to lay them over the current image. Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
BoltBait Posted August 29, 2009 Share Posted August 29, 2009 Here is a good example: http://www.boltbait.com/pdn/codelab/hel ... seedButton Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
APShredder Posted August 29, 2009 Author Share Posted August 29, 2009 Well, I looked at your code example, but I'm not sure if it is of any use to me. I assume the part of the code your talking about was this: if (RandomNumber.Next(255) > 128) { CurrentPixel = Amount1; } Maybe I'm just not looking at it right, but what I'm trying to do is select a certain number of pixels randomly from a pre-existing image based on an amount the user put in. Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
Simon Brown Posted August 29, 2009 Share Posted August 29, 2009 I've modified the code I previously sent you and the pattern seems less predictable now. http://www.isimonbrown.co.uk/files/Dissolve.zip Quote Link to comment Share on other sites More sharing options...
APShredder Posted August 29, 2009 Author Share Posted August 29, 2009 Thanks Simon! That's exactly the effect I was looking for. I have to say, I really appreaciate all the work and effort you've put into plugin. I really feel like I should put you down as a co-author for this plugin. Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
Simon Brown Posted August 29, 2009 Share Posted August 29, 2009 Just one second thought: In EffectPlugin.cs: Find: public EffectPlugin() : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, EffectFlags.Configurable | EffectFlags.SingleThreaded) { rand = new Random(); } Replace with: public EffectPlugin() : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, EffectFlags.Configurable | EffectFlags.SingleThreaded) { } Find: static Random rand; Replace with: static Random rand; protected override void OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) { rand = new Random(); } Quote Link to comment Share on other sites More sharing options...
APShredder Posted August 29, 2009 Author Share Posted August 29, 2009 OK the changes are all made. And one last thing, would you like me to add you as a co-author when I publish this? Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
Simon Brown Posted August 29, 2009 Share Posted August 29, 2009 Don't bother. Edit: Fixed typo. Quote Link to comment Share on other sites More sharing options...
APShredder Posted August 29, 2009 Author Share Posted August 29, 2009 Ok, if you're sure. Quote BlendModes Plus | Dissolve | Extract Color Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.