- Python Multimedia
- Ninad Sathaye
- 101字
- 2021-08-03 15:27:39
Time for action – reading images from archives
Suppose there is an archive file images.tar
containing image file image1.jpg
. The following code snippet shows how to read image1.jpg
from the tarball.
>>>import TarIO >>>import Images >>>fil = TarIO.TarIO("images.tar", "images/image1.jpg") >>>img = Image.open(fil) >>>img.show()
What just happened?
We learned how to read an image located in an archived container.
Have a go hero – add new features to the image file converter
Modify the image conversion code so that it supports the following new functionality, which:
- Takes a ZIP file containing images as input
- Creates a TAR archive of the converted images
推薦閱讀
- AJAX and PHP: Building Modern Web Applications 2nd Edition
- Photoshop CC摳圖+修圖+調(diào)色+合成+特效標(biāo)準(zhǔn)培訓(xùn)教程(全視頻微課版)
- Photoshop CS5平面設(shè)計(jì)入門與提高
- SolidWorks 2021中文版機(jī)械設(shè)計(jì)從入門到精通
- Puppet 2.7 Cookbook
- Jetpack Compose:Android全新UI編程
- 中文版After Effects 2022基礎(chǔ)教程
- UG NX12中文版實(shí)用教程
- Premiere Pro基礎(chǔ)與實(shí)戰(zhàn)教程
- 跨境電商:速賣通搜索排名規(guī)則解析與SEO技術(shù)
- AutoCAD 2020與天正建筑T20 V6.0建筑設(shè)計(jì)從入門到精通
- 中文版Photoshop 2020基礎(chǔ)培訓(xùn)教程
- SilverStripe 2.4 Module Extension, Themes, and Widgets: Beginner's Guide
- AI賦能Rhino產(chǎn)品造型創(chuàng)意設(shè)計(jì)(視頻教學(xué)版)
- Photoshop CC 從入門到精通