课程: Python Essential Libraries
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Editing images
- [Instructor] All right, let's finish up our introduction to the Pillow imaging library with some examples, of editing the contents of images. The Pillow library provides capabilities for altering the pixel content of images, by using a simple 2D graphics drawing API. You can use theses functions to create new images or annotate or retouch existing images, and to generate graphics on the fly for a variety of uses. Such as water marking images on the web. So for our first example let's take an existing image and draw some simple content into it. So to do that let's go ahead and open our editing underscore start file. In order to make use of these drawing functions, I need to import the ImageDraw class. So let's go ahead and do that up here. I'll import ImageDraw. All right, then I'll open the image using, the same method that we've seen so far. So I'm going to call the open function on the image class and pass in my infile…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。