Jump to content


  • Posts

  • Joined

  • Last visited

About phrebh

  • Birthday 01/01/1970

Profile Information

  • Location
    Midwest, US
  • Interests

Contact Methods

  • Website URL

phrebh's Achievements


Contributor (5/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges



  1. There are two reasons for me to continue. The first one is that I started my plugin months before yours was posted. But most importantly, you are doing it wrong. Averaging the RGB values will not give you the proper color. You have to average the HSV values, which is why my averaging code is so complicated. I removed the IsVisible check because there are many instances in the forums where the really experienced people say not to use it. Ever. Through testing, I know that using rect.top, etc., is working because I get different results for different parts of the same region. I won't pretend to understand why. You do have an excellent point about the running average, though, and I agree that I need to readdress it, but I don't see how that will fix my underlying problem of the missing lines. Thanks!
  2. This actually uses offset pictures which is how you get a real 3D effect instead of a pseudoeffect like Tabou's gives you. To do this with your own pictures, put your weight on your left foot and take a picture. Tehn shift your weight to your right foot and take a picture. Use those images as your starting points and you can create an anaglyph of whatever you'd like. This only works if your subject can stay perfectly still for this process, so no 3D images of children will be possible.
  3. He was on today. Which is why I'll post this request. Your Selective Palette plugin is pretty awesome, but what would make it awesomer is for it to dither the results rather than just using a nearest to color. I've tried a combination of the Dither plugin from whoseits (sorry, I can't remember and I don't feel like looking it up) and this one, but none of the combos work nearly as well as the color reducing functionality I got to know and love in PSP. Just a thought. Thanks!
  4. Okay, over a year has passed and I've finally gotten around to revisiting this plugin. Thanks to help from both Curtis and EER, I've almost got this finished. Maybe it's just because I've been doing a lot of programming (in various non-C# languages) this year, but replacing the global class with a global variable was a fairly thing to do. For the most part it works, but occasionally it produces transparent, horizontal lines instead of a completely solid color. It seems to happen mostly with elliptical selections, although I have seen it with rectangular ones, too. I have not seen them when averaging the entire image. Strangely enough, if I force CodeLab to re-render it, sometimes the transparent lines go away. I should point out that it happens whether or not a put the IsVisible check as part of the rendering in the final for loop. Any thoughts or advice? Thanks! EDIT: I removed both instances of the isVisible line and adjusted the rest of the code accordingly. It now seems to work for most selections, but with some selections, or if nothing is selected, it seems to either show a dark gray or just the top left pixel color. I've updated the code below with the changes. CodeLab code: private bool set = false; private ColorBgra AverageColor; // Based on Rik Hemsley's code posted on the org.kde.kde-core-devel list. ColorBgra average(ColorBgra fg, ColorBgra bg) { const double d0 = (double)256; const double d1 = 0.2979; const double d2 = 0.5866; const double d3 = 0.1145; const double d4 = -0.1687; const double d5 = 0.3312; const double d6 = 0.5000; const double d7 = 0.4183; const double d8 = 0.0816; const double d9 = 1.4022; const double d10 = 0.3456; const double d11 = 0.7145; const double d12 = 1.7710; const double mix = 0.5; double y, cb, cr, y0, cb0, cr0, y1, cb1, cr1; double r0, g0, b0, r1, g1, b1; ColorBgra ret = fg; r0 = (double)fg.R / d0; g0 = (double)fg.G / d0; b0 = (double)fg.B / d0; r1 = (double)bg.R / d0; g1 = (double)bg.G / d0; b1 = (double)bg.B / d0; y0 = d1 * r0 + d2 * g0 + d3 * b0; cb0 = d4 * r0 - d5 * g0 + d6 * b0; cr0 = d6 * r0 - d7 * g0 - d8 * b0; y1 = d1 * r1 + d2 * g1 + d3 * b1; cb1 = d4 * r1 - d5 * g1 + d6 * b1; cr1 = d6 * r1 - d7 * g1 - d8 * b1; y = y0 + mix * (y1 - y0 ); cb = cb0 + mix * (cb1 - cb0); cr = cr0 + mix * (cr1 - cr0); ret.R = (byte)(d0 * (y + d9 * cr)); ret.G = (byte)(d0 * (y - d10 * cb - d11 * cr)); ret.B = (byte)(d0 * (y + d12 * cb)); ret.A = (byte)255; // always set to no transparency to make the result visible return ret; } void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); ColorBgra CurrentPixel; if (AverageColor == null) { AverageColor = src[rect.Top,rect.Left]; } if (!set) { set = true; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; AverageColor = average(AverageColor, CurrentPixel); } } } // fill out selection with average color for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { dst[x,y] = AverageColor; } } }
  5. Yes, but unfortunately that's about as pointless as having animated gifs was in the early '90s. There's little point in going through the trouble without IE support, since most people use it (weirdos).
  6. Thanks! I started with a blank canvas in PDN and made the skull out of some simple shapes. I never actually thought about animating it. It would look cool, but I'm afraid the limit of 256 colors in a gif would detract too much from the rest of it. I really like the flowers and cat. It's not often that you see basically three colors used so effectively.
  7. I like the large render; it adds foreboding. Here are my new avatar and sig:
  8. His head is attached, it's just that the top of his body is black, so it's hard to tell. Thanks! And I like the greyscale nature of your SIG. I think it would be too busy if you colorized it.
  9. Am I the only who can't see the link to the update? It's not where it was this morning.
  10. Then maybe you better give her the method, because that didn't work for me. Are you talking about his image tiler?
  11. That won't fill a blank canvas with repeated gradients.
  12. You have two choices from what I can see. The first is to select part of the image before you apply your gradient, and then select another part for the next gradient, etc. The second is to use the Multi-color gradient plugin. You can choose up to 20 gradient parts, giving you 10 side-by-side gradients. If you post an example, I'm sure many people will step up to try a more specific approach.
  • Create New...