×

Discussion Board

Results 1 to 4 of 4

Threaded View

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    4

    IS there a Fast way to Make an image filter in PyS60?

    Hello everyone, I have some coding experience in Python but I'm new at PyS60.

    Now, I'm on a project as they are a Good way to learn new things dynamically.

    My target is to make an invert color filter,

    What I've done is
    Code:
    from graphics import  *
    import e32
    
    s=raw_input("Enter Image Location \n=")
    im=Image.open(s)
    img=Image.new(im.size, "L")  #my need is to make it B&W then invert
    img.blit(im)
    
    img.save("E:\\F.jpg")
    print "F.jpg has been generated"
    
    def invertclr(img2):
        width, height= img2.size
        img3=Image.new(img2.size, "L")
        for y in range(height):
           for x in range(width):
             c=img2.getpixel((x,y))[0]
             r,g,b=c
            img3.point((x,y), (255-r, 255-r, 255-r))
            #e32.ao_yield()
     img3.save("E:\\F2.jpg")
    
    invertclr(img)
    print "E:\\F2.png has been generated"
    The colors are Successfully getting inverted,
    But it takes Long times to do it
    Inventing An Image of 477x535 needed 41 seconds

    But I have an feeling that it can be done in 1 or 2 seconds,

    Actually, when I Make an B&W image an Invert its colors, and if this image is used as a mask. It creates a pretty good image filter.

    Any kind of help will be appreciated.

    EDIT: removing the e32.ao_yield inside the loop (now commented) reduced the time by 11 seconds, but its still not quite enough.

    will it run fast inside a class or a compiled script??
    Last edited by ronnie.basak96; 2012-04-30 at 08:19. Reason: Improvement

Similar Threads

  1. Is it possible to make a fast M3G animation with spotlights?
    By MobileVisuals in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2011-11-25, 10:12
  2. Unhandled exception filter called from program make
    By template60 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2011-02-23, 23:14
  3. Fast Image Capture
    By Tobias_80 in forum Symbian Media (Closed)
    Replies: 9
    Last Post: 2007-06-18, 12:29
  4. Fast Start Up Image
    By gjk in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-09-12, 06:31

Posting Permissions

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