transparent images

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • moishyyehuda@gmail.com

    #1

    transparent images

    Does any one know how to make a transparent image with specifically
    PIL, but any standard python library will do. I need a spacer, and it
    has to be transparent.

    Thanks

  • Brian

    #2
    Re: transparent images

    moishyyehuda@gm ail.com wrote:
    Does any one know how to make a transparent image with specifically
    PIL, but any standard python library will do. I need a spacer, and it
    has to be transparent.
    >
    Thanks
    >
    Does this have to be done through Python? If not, you might enjoy GIMP
    (http://www.gimp.org), which can do this easily. Best of all, you can
    customize the size, etc.

    Dusty
    ---

    Comment

    • half.italian@gmail.com

      #3
      Re: transparent images

      On May 15, 5:26 pm, moishyyeh...@gm ail.com wrote:
      Does any one know how to make a transparent image with specifically
      PIL, but any standard python library will do. I need a spacer, and it
      has to be transparent.
      >
      Thanks
      Something like this...not my code...untested ...

      im = Image.open("ima ge.jpg")
      opacity = .5
      if im.mode != 'RGBA':
      im = im.convert('RGB A')
      else:
      im = im.copy()

      alpha = im.split()[3]
      alpha = ImageEnhance.Br ightness(alpha) .enhance(opacit y)
      im.putalpha(alp ha)

      ~Sean

      Comment

      Working...