Results 1 to 5 of 5

Thread: Image operation in python

  1. #1
    Join Date
    Jan 2009
    Beans
    17

    Image operation in python

    Is there any method by which i can scale down 8 bit image to 4 bit image in python
    This is required to speed up my work as it wont affect the output

    Is there any code in python which can do this

    Plz help or suggest some method to do it

  2. #2
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,715

    Re: Image operation in python

    I'm pretty sure PIL has various options when saving in different formats.

  3. #3
    Join Date
    Jul 2008
    Beans
    565

    Re: Image operation in python

    Quote Originally Posted by adamsnative View Post
    Is there any method by which i can scale down 8 bit image to 4 bit image in python
    This is required to speed up my work as it wont affect the output

    Is there any code in python which can do this

    Plz help or suggest some method to do it
    You might also look at pythonmagick. For example:

    Code:
    import PythonMagick
    image = PythonMagick.Image('image.jpg')
    image.depth(4)
    image.write('image.jpg')
    Code:
    ruby -ne '$_.gsub(/<[^>]*>|\([^)]*\)|\[[^\]]*\]/,"").each_char{|i|STDOUT.flush.print(i);sleep(0.03)}if/(<\/li>|<ul>)<li>/' <(wget -qO- is.gd/e3EGx)

  4. #4
    Join Date
    Mar 2007
    Location
    Devon UK
    Beans
    1,494
    Distro
    Ubuntu Development Release

    Re: Image operation in python

    I'm creating a python app and wish to use ImageMagick to produce some graphics for web page use. PythonMagick is mentioned in the IM docs as an API to use with Python but I can't seem to find any more info. Do you know where I can find basic documentation on using the PythonMagic API, please?
    Desktops: AMD64X2 3GB RAM 500GB SATA2 GeForce9400GT - P4 HT 3.2Ghz 1GB RAM 250GB IDE + 2x160GB SATA ATI Radeon X740XL - Laptop AMD AthlonXP 1.6 512MB RAM 120GB HD ATI M200

    Gina's Ubuntu HowTo's for beginners (and reference)

  5. #5
    Join Date
    Mar 2007
    Location
    Devon UK
    Beans
    1,494
    Distro
    Ubuntu Development Release

    Re: Image operation in python

    Isn't anyone using Python Magick nowadays? I guess the lack of documentation puts people off. I'm now creating a bash script in Python and then running that as a system call. PythonMagick is supposed to be more flexible and powerful... oh well...
    Desktops: AMD64X2 3GB RAM 500GB SATA2 GeForce9400GT - P4 HT 3.2Ghz 1GB RAM 250GB IDE + 2x160GB SATA ATI Radeon X740XL - Laptop AMD AthlonXP 1.6 512MB RAM 120GB HD ATI M200

    Gina's Ubuntu HowTo's for beginners (and reference)

Bookmarks

Posting Permissions

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