Roly Poly Goblinoli Posted August 22, 2014 Posted August 22, 2014 (edited) Overview This simulates resolution loss. All it does is take the values of each color channel (and optionally the transparency channel), divide by a number, round, and multiply by that number again. This simple math trick causes values to snap to multiples of the given number. So if I take the image and provide 8 as a number, every color channel should, theoretically, be a multiple of 8. Edit: This effect can be simulated by the Channel Ops plugin I developed, so this effect is only good for convenience if used often. Simple gif of gradients demonstrating the effect over its range. Progressive resolution (this was manually done). Purpose and Application You can make stylized images, create unusual and aesthetic dithering effects, and simulate different resolutions without actually saving the image in two different resolutions. Located in the Stylize menu under the Effects tab. Options Resolution Loss: The colors (and optionally alpha) will become multiples of this number to simulate resolution loss. Affect transparency: Whether or not the transparency channel should be affected by the truncation process. Remarks With the resolution loss, from 171 and on, a natural effect of the multiples causes the image to get a bit darker before progressing towards 255. This is because at 170, there can no longer be any multiples that reach 255, making 171 the largest possible number. 170 and under are immune to this effect because White / 170 = 1.5, which is the last number that rounds up (white = 255). There are other small divots in color change due to prime number multiples that cannot get high enough to reach 255. This is not contrast and cannot be simulated properly by contrast algorithms. I was a bit surprised not to see one of these already, as they're quite simple Source #region UICode int Amount1 = 30; //[1, 255] Resolution Loss bool Amount2 = false; //[0,1] Affect transparency #endregion //Simply rounds a number to the nearest 'roundTo' point. //roundTo is an absolute value, so negative numbers are ignored. float Round(float roundTo, float data) { data = (int)Math.Round(data / roundTo) * roundTo; return data; } void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; //Truncates the colors. CurrentPixel.R = Int32Util.ClampToByte((int)Round(Amount1, (float)CurrentPixel.R)); CurrentPixel.G = Int32Util.ClampToByte((int)Round(Amount1, (float)CurrentPixel.G)); CurrentPixel.B = Int32Util.ClampToByte((int)Round(Amount1, (float)CurrentPixel.); //Truncates alpha if the user wanted it to do so. if (Amount2) { CurrentPixel.A = Int32Util.ClampToByte((int)Round(Amount1, (float)CurrentPixel.A)); } dst[x,y] = CurrentPixel; } } } Truncate Resolution.zip Edited July 21, 2017 by Joshua Lamusga 1 Quote
Don Gordon Posted August 31, 2014 Posted August 31, 2014 When I download the .dll Norton finds and deletes it. If I turn off Norton, install it, Norton finds it in the PDN folder and deletes it. Any ideas? Thankyou Quote
BoltBait Posted August 31, 2014 Posted August 31, 2014 When I download the .dll Norton finds and deletes it. If I turn off Norton, install it, Norton finds it in the PDN folder and deletes it. Any ideas? Thankyou Here's an idea: Get rid of Norton's Anti-Virus. Seriously, it is the worst anti-virus program out there. There are free ones that are WAY better than Norton's. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
nitenurse79 Posted August 31, 2014 Posted August 31, 2014 Here's an idea: Get rid of Norton's Anti-Virus. Seriously, it is the worst anti-virus program out there. There are free ones that are WAY better than Norton's. Agreed. Norton and all the other paid variations throw out false positives to justify their price tag! Quote
Goonfella Posted August 31, 2014 Posted August 31, 2014 (edited) Try Avast Free. Excellent AV. Been using it for years on the laptop and now the mobile version on the phone & tablet. Back on topic- interesting plugin Anthony. Nice gif showing what it can do. Thanks. Edited August 31, 2014 by Goonfella 1 Quote Please feel free to visit my Gallery on PDNFans And my Alternatives to PDN
TechnoRobbo Posted September 1, 2014 Posted September 1, 2014 AnthonyScoffler, Save your uploads as ZIP files. DLL's get flagged by everything with an "anti" in their description. Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins
Roly Poly Goblinoli Posted September 3, 2014 Author Posted September 3, 2014 (edited) Quote When I download the .dll Norton finds and deletes it. If I turn off Norton, install it, Norton finds it in the PDN folder and deletes it. I have zipped my .dll file. Edited July 21, 2017 by Joshua Lamusga Quote
TechnoRobbo Posted September 3, 2014 Posted September 3, 2014 No need to be so drastic, Norton allows the user to exclude an apps and folders from it's virus scan. Still, zip your dll's, my google chrome issues a warning. Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins
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.