Thread: image resizing algorithms.....

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    22

    Cool image resizing algorithms.....

    Hi all......

    How to use image resize algorithm like bilinear interpolation algo in C?

    is there any site or link regarding this?


    Thanks in advance
    Bhupesh
    www.hindisongschords.blogspot.com

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Did you try google?

    This seems to be a good page:
    http://wiki.allegro.cc/index.php?title=BilinearResize

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382
    When the destination image is larger, loop in terms of its X and Y, then to find the source pixel to copy, divide both X and Y by the scale factor. If you use ints, then you will get the simple 'nearest neighbour' style algorithm when you copy from source to destination.

    Otherwise they will need to be floats - the mantissas (mantissae?) of which (calculated as n - (int) n) will be your interpolation degree between adjacent pixels.

    It is then up to you how you choose to blend adjacent colours based on this value.
    Last edited by samGwilliam; 09-17-2008 at 06:15 AM.
    Current Setup: Win 10 with Code::Blocks 17.12 (GNU GCC)

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    22

    Post

    Hi matsp n Sam

    Thanks for the reply...
    thanks for the link, here i got some valuable info on that. (allegro wiki)..


    Bhupesh
    www.hindisongschords.blogspot.com

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    If you are on Windows and you want a fast solution (and by fast I mean run-time and coding-time) then I believe GDI+ has bilinear filtering capabilities.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. image watermarking algorithms
    By dantu1985 in forum C Programming
    Replies: 1
    Last Post: 01-02-2008, 01:59 PM
  3. [C++/WinAPI] Resizing image
    By jagi in forum Windows Programming
    Replies: 2
    Last Post: 04-04-2005, 07:44 AM
  4. image resizing
    By eth0 in forum C++ Programming
    Replies: 2
    Last Post: 09-15-2004, 01:08 AM
  5. Image resizing
    By Jock in forum Linux Programming
    Replies: 3
    Last Post: 02-20-2002, 01:48 PM