User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Picture Resize Methods Linear, Cubic, Sinc Larcosz

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Picture Resize Methods Linear, Cubic, Sinc Larcosz

    I sarch for an extension or a method that can resize in the linear way, cubic, Sinc Larcosz. Not at runtime, but as a saveable result.

    What i mean is this. Overlay and Image Manipulator resizes without any method. Results in a 1:1 resizing with sharp borders when i resize a 5X5 pixel picture with some black pixels at it up to 128 pixels.



    What i need is one of the following methods though:

    Linear:



    Cubic:



    sinc (lanczos3), my Favourite. This one would be best:



    Is there a method to achieve such a resized result in Overlay? Or is there even an extension that can resize in one of the mentionend methods that i have overlooked?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleFirefly 3D ModuleInstall Creator Pro
    Brovic's Avatar
    Join Date
    Jul 2006
    Location
    France
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Larcosz

    Overlay has a feature "enable antialiasing". Doesn't it work ?
    Or can't you just paste a resampled active in the overlay ?

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    Thanks for your suggestions. Those methods doesn't work though.

    Antialias is either on or off. Nothing to resample a picture with. The result is therefore that i may get more squares in the result, with a grey colour. Or just a two pixel border around my black blocks.

    Acitves cannot load pictures at runtime afaik, nor can it save a picture then. So there is no way to use its resampling.

    What i'm tinkering around with at the moment is to read the greyscale values into an array. And try to resample it there. Let's have a look.

    Best method would be an extension though. Because Overlay and Array in Fastloop is slow as hell.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    The beta version of the new overlay object can do one of these resampling algorythms but I don't know when it will be finished...

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    ... but I don't know when it will be finished...
    Argh

    What can i do to speed the release date up ?

    Okay, this means i have to go the overlay/array/fastloop route then.

    But I spit blood and water here with my array solution though. My favourite annoyer strikes back here. Only 9 values through nine gives, correct, five points ... :sick:



    Comeon, this is not a really complex formula. It is simple math :/

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    I've trashed the array and use counters now to set the surrounding pixels. Works now Even when it takes nearly 10 seconds for this 128x128 pixel picture.

    But i do nevertheless something wrong. The result doesn't look correct. Not even near the result of the above methods. Either the result is not soft enough or the whole white area becomes grey like in the picture here. What am i doing wrong?



    How can i achieve the resample methods that are shown above?


  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    youve got a blackborder cause its trying to get the colours from outside the image bounds. And the whole thing turns greyish cause (i think) you're getting adjacent pixels that you've already changed in the previous loop. Instead, loop through an image source, and create the blur in another image - target.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    Thanks for posting.

    I still use a source and a target picture. And i always calculate from the one to the other

    What i wonder is not so much the border. I have to change the loop to take the borders into account when done. That part is not finished yet.

    What i wonder is that i don't come close to the above results. That i cannot get this clear white areas. In none of the above methods i have such a strong bleeding. Not in linear, not in cubic nor sinc (lanczos3). But with my method i have. As the picture shows.

    What's the correct formula for linear for example? Current Pixel + cross surrounding ones? Means the one up, the one left the one down the one right, and the result through 5?

    Or cubic? Is it really all surrounding pixels through 9?

    Do those method even take the current pixel into account?

    I tried some methods now. It looks close to what i have shown here. There must be something different.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    Ah, getting closer. I have to check pixels further away. The further away the less samples are necessary. And the less it bleeds.

    This is a result that checks pixels which are 3 pixels away, five samplings:



    Would be nevertheless interesting to know the exact formulas. My current method to intend the wheel again is a bit time consuming :grin:

  10. #10
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Picture Resize Methods Linear, Cubic, Sinc Lar

    First step is always to divide the coordinates of the point you are drawing in the destination so that they are in the source image. If the source is 4x4, and dest is 12x12, then pixel 4,5 in the dest is 1.333,1.666 in the source.

    Obviously there is no pixel at 1.333,1.666, so you have to blend the surrounding pixels to get it. For linear, this is simply:
    ColourAt(1,1)*(1-0.333)*(1-0.666) + ColourAt(1,2)*(1-0.333)*(0.666) + ColourAt(2,1)*(0.333)*(1-0.666) + ColourAt(2,2)*(0.333)*(0.666)

    Linear basically uses 2x2 samples. Cubic uses samples further away to fit a cubic curve, and reads off the point at the appropriate coordinates. Cubic preserves detail better than linear, which tends to blur.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Linear Filtering?
    By stuckboy in forum Hardware Accelerated Runtime
    Replies: 5
    Last Post: 19th July 2009, 01:10 PM
  2. 360 Degree and Cubic Panorama Extensions
    By Novabrain in forum Extension Developers Lobby
    Replies: 1
    Last Post: 15th March 2008, 09:51 PM
  3. Active Picture Resize Methods
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 5th February 2008, 12:39 PM
  4. Cubic resampling
    By Tiles in forum File Archive
    Replies: 7
    Last Post: 26th January 2008, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •