Jump to content

Hawkynt

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Hawkynt

  1. The executable is not for Paint.NET. It can be used without Paint.NET to resize images from the command line or by using the built-in GUI.
  2. OK guys, from Version r25b on, it will be under Tools. I just released it.
  3. I finally packed my image filtering library into a Paint.NET Plugin which can be downloaded here: 2dImageFilter-r133.dll https://hawkynt.github.io/2dimagefilter/ Find these filters in Effects > Tools > 2D Image Filter This library contains all of the standard algorithms used in various emulators (like VirtualGB, Mame, DOSBox, SNES9x, ZSNES to name some of them). I adapted them to be used not only on pixel graphics by giving them the ability to identify pixels that are alike and not exactly the same color. They will interpolate on matches to give slightly better results than their original. Even though some scaler's seem to result in the same image, they're all slightly different and the best fit heavily depends on the source material. All Algorithms have been rewritten from scratch by looking at the original code, understanding and then adapting so these should be clean (schoolar) version of the algo's. Thanks to all the people that made up their minds and invented these scalers. Without them I couldn't have coded this. To demonstrate some of the filtering techniques, I will use this image: Scale2x: AdvInterp2x: Scale3x: AdvInterp3x: Bilinear+(Original): Bilinear+: Eagle2x: Eagle3x (I invented this one because it did not exists before): Eagle3x(Variant B ): Super Eagle: Scale and Interpolate (alias SaI2x): Super Scale and Interpolate (alias SuperSai): EPXB: EPXC: EPX3: HQ2x(Normal, Bold and Smart, HQ4x, HQ2x3, HQ2x4, etc.): HQ3x(which is also available as normal, bold and smart version): LQ2x(also LQ3x, LQ4x, Normal, Smart, Bold, LQ2x3, LQ2x4, etc.): XBR4x( also XBR2x, XBR3x, with and without color interpolation): Also included in this package: Scanline Effects, RGB Effects, TV Effects, RGB- and YUV- Channel extraction and many more. I recommend using "Render to Clipboard" and paste the result into a new image because the plugin can not resize the canvas itself. The development thread can be found here.
  4. OK we'll do that when we got this XBr working as expected. Hyllian, I tracked your 3x differencies back in code, thanks for the standalone version. Without it I wouldn't been able to find the differencies. It's like I assumed earlier: You changed your filter code over time so this is the difference in 3x FILTRO: #if ORIGINAL_IMPL if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(ph, pd) || _IsEqual(pe, pi) && (!_IsEqual(pf, i4) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) { #else if ((e < i) && (!_IsEqual(pf, pb) && !_IsEqual(pf, pc) || !_IsEqual(ph, pd) && !_IsEqual(ph, pg) || _IsEqual(pe, pi) && (!_IsEqual(pf, f4) && !_IsEqual(pf, i4) || !_IsEqual(ph, h5) && !_IsEqual(ph, i5)) || _IsEqual(pe, pg) || _IsEqual(pe, pc))) { #endif The Part in the ORIGINAL_IMPL is the one from your standalone, the one below is the one from your original C-sources. I'll now continue on the 4x and 2x differencies. Can you tell me which of all your 2x'es you used ? Edit: 4x is also solved, you used 4x v2 which is slightly different. Edit: 2x is solved, you used 2x v5. I'll release the current version.
  5. Isn't it already publicy available ? I mean everyone can download it already.
  6. Could you please send me the source code from your standalone app to compare sources ?
  7. OK could you tell me which weights you use for blending ? formula is c=(a*n+b*m)/(n+m) Just need to know the values n and m for each blend case to fix that. Your code was optimized so I thought these were yours (could you pls confirm?): 32W 7:1 64W 3:1 128W 1:1 192W 1:3 224W 1:7
  8. But in the 3x version everything is done without interpolation ....
  9. I used PaintDotNet to find the differencies in our results. Hope this helps to identify which conditions in source could be different from yours. 2x->ref 3x(NoBlend)->ref 4x->ref
  10. You mean 3x, right ? Because I can not see any differencies in 4x's cross down right. The alpha blend was modified with the code you gave me when we talked about performance hacks. From this time on, I realized what you were doing and simply used methods I already had. It seems to me that the kernel code is affected and switches wrong. Or it does not combine the right pixels. Btw: This is Sonic from the SEGA console systems: And I'm from germany/berlin
  11. The white block is his belly button and the green one on his nose is just the nostril from the other side *just kidding* But still it looks good. So what do we want to do with the 2x checkerboard glitch ? The accuracy of your filter is really good, I agree, but the most important: you forgot Sonic in your test image Your filter has the widest matrix for it's kernel from all algo's I implemented, so it could be theoretically possible to detect circles not only lines. This is why I'm using the other test-pattern. It has straight lines, 90° corners, 45° lines, 22.5° lines which form a circle (the smilie), a checkerboard and gradients. All of these are tasks a perfect filter should master. Your matrix has potential for that. If you have time in the future to invent a new filter, this should be the directions where you could improve your solid base from the xbr on. If you still rely on your (more related to practice then theory) test image, you could try to detect Boo's round shape or the head of Toad. These should be similar to my (more theoretical) test-pattern. Btw: Where are you from ?
  12. XBR3x XBR3x(NoBlend) PS:You could also resize the image on your own with the executable from here 2dimagefilter@googlecode.
  13. Yeah but these Jaggies may look nice sometimes depending on image material and resolution (like with every filter of course). I also like the 3x version more than your original because it renders sharper 90° edges. Looking forward to see where the bug in the 2x implementation is PS: The implementation for these is is sPixel.cs, they're mathematically equal to yours and were also used in Hqnx filters and all the others I upgraded.
  14. OK I released the next version. I reverse engineered how your version without blending works and added three more filters to the library which are basically yours without blending. Xbr2x(NoBlend) Xbr3x(NoBlend) Xbr4x(NoBlend)
  15. Left is my result, right is the reference image you provided. XBR2x (Checkerboards do not match with yours, as well as 2*2 pixel blocks) XBR3x (Your reference image did not have any interpolated pixels, poss. wrong ref. image ?) XBR4x (this seems to be identical with your version) The biggest difference here I see in the 2x/3x is at the checkboard texture. Don't know why this happens (yet)
  16. Hi folks, the next update is out there, where I implemented the XBR algorithms as requested. But I'm still getting different ouput even though I converted the original C source code to C#. Check it out yourself and if someone sports the differencies in the code and how to fix them, pls feel free to contact me.
  17. OK here you go. I figured out a way how the filters could implement the alpha channel without simply copying it from the source. So now there is support for alpha images, too. With releases starting from r20 on, the alpha channel will no longer being blacked out and alpha values will also be interpolated whenever a filter needs to interpolate points. I think this way the alpha gets seamlessly integrated into existing filters. Don't forget to remove the old plugin dll, because it has a different name.
  18. These filters were not invented to be used on alpha images. I even don't know how I should expand their algo's for a fourth channel. That's the reason why your alpha gets blacked out. Sorry
  19. So does this mean that: - your native scaler resolutions are 2x,3x,4x and 5x (because the others are only repeated scaling several times) - you can not rewrite your C code to use functions declared as "inline", "_inline" or "__inline" to do the same (typing would be nearly equal ) - your 5x is only in cg - the word group you asked for means comparing pixel colors for "equality" not "similarity", AFAIK your code does this, so I would rewrite it to support thresholds in comparisons because this would make your filters usable on aliased images Are my assumptions correct ?
  20. yeah, i'd really enjoy including it. on the weekend i'll hopefully have enough time to study your rules. it's great to see that someone else is trying to improve image scaling algo's. ok read it once now, having some questions: - is it right that your filter does direct equal comparisons to pixel colors ? - are there four variants of your algo: 2x, 3x, 4x and 5x (if so, is there code for 5x ?) - I could not fully follow your specs, could you be more descriptive and send code with no preproc macros pls - could you use the source image i provided here and scale it, so i could compare any of my implementations later Thanks a lot in advance.
  21. As you mentioned, I already looked at the plugin you described and I also had a post there, encouraging the author to use my library. But sadly he did not answer, so I wrote my own one. You already noted that there are many more filtering algo's in my plugin than in his own and there are also differencies in how they exactly work. Pikalek (that's the author of the other plugin) tried to get the implementation as close to the original as possible while I tried to rewrite them and adapt them to a "far-near color model" similar to the one that's used in Hq filters. To get more in detail: The original scalers from Kreed and Co. compare pixel by color, and only apply their patterns if the pixels have the exact same colors: Something like if(pixel1.Color==pixel2.Color) {;} I changed that code everywhere and compared using YUV color space with thresholds to identify similar color values: if(pixel1.Color.IsLike(pixel2.Color)) {;} This also meant that I had to modify the pattern code to take into account that the source pixels are now slightly different under certain conditions. So I took code like: if(pixel1.Color==pixel2.Color) outputPixel1.Color=pixel1.Color and changed it into if(pixel1.Color==pixel2.Color) outputPixel1.Color=Interpolate(pixel1.Color,pixel2.Color) This way the images got a much better filtering. I did this years ago because I wanted to use these popular filtering techniques on images which are not that color perfect because of lossy compression and other degrading image manipulation. It was also interesting to see what happens when you apply these algo's to stuff that they werem't designed for: drawings, paintings and photos.
  22. OK try this: -open an image you want to resize -go to effect->Hawkynt->2dimagefilter -choose for example hq4x from the dropdown -press "render to clipboard" -click on "cancel" or press "ESC" -click File->New or press "CTRL+N" -click OK or press "Enter" -click Edit->Paste or press "CTRL+V" Your resized image should now be there in full resolution. BTW: I'd really like to make this more intuitive but according to this post it seems to be impossible.
  23. Jep, as I told: It does not resize the image but the filters are meant to work this way. So the following happens: - the filter takes your whole image and magnifies it by eg factor 2 in x and y (like Eagle does or Hq2x) - now it tries to write back the information to paint - paint is still having an image with the original size, so it only writes the upper left part of the resized version back This leads to your problem. There are two workarounds: Either resize the image first and let your source image be in the upper left corner. (This is slower because white space is also filtered and you have to know the exact dimensions of the filtered image beforehand) Or simply press "Render to Clipboard" instead of the "OK" button in the filter configuration and then make a new image with the size from the clipboard and simply paste. (CTRL+N, ENTER, CTRL+V should do the trick ) If someones knows how to programmatically tell paint that the image sizes was changed by the filter, tell me how and I will fix that. ^^
  24. I finally packed my image filtering library into a Paint.NET Plugin which can be downloaded here : 2dImageFilter. This library contains all of the standard algorithms used in various emulators (like VirtualGB, Mame, DOSBox, SNES9x, ZSNES to name some of them). I adapted them to be used not only on pixel graphics by giving them the ability to identify pixels that are alike and not exactly the same color. They will interpolate on matches to give slightly better results than their original. Even though some scaler's seem to result in the same image, they're all slightly different and the best fit heavily depends on the source material. All Algorithms have been rewritten from scratch by looking at the original code, understanding and then adapting so these should be clean (schoolar) version of the algo's. Thank's to all the people that made up their minds and invented these scalers. Without them I couldn't have coded this. To demonstrate some of the filtering techniques, I will use this image: Scale2x: AdvInterp2x: Scale3x: AdvInterp3x: Bilinear+(Original): Bilinear+: Eagle2x: Eagle3x (I invented this one because it did not exists before): Eagle3x(Variant B ): Super Eagle: Scale and Interpolate (alias SaI2x): Super Scale and Interpolate (alias SuperSai): EPXB: EPXC: EPX3: HQ2x(Normal, Bold and Smart, HQ4x, HQ2x3, HQ2x4, etc.): HQ3x(which is also available as normal, bold and smart version): LQ2x(also LQ3x, LQ4x, Normal, Smart, Bold, LQ2x3, LQ2x4, etc.): Also included in this package: Scanline Effects, RGB Effects, TV Effects, RGB- and YUV- Channel extraction and many more. I recommend when using scaling algorithms to resize the image before applying them because I don't know how to do this from within a plugin or use "Render to Clipboard" and paste the result into a new image. Hope you'll give me feedback about it.
  25. Hi, you could simply use my C# image filter library from here 2dimagefilter at googlecode. I'd like to see that in your plugin
×
×
  • Create New...