Giter VIP home page Giter VIP logo

yebarryallen

using python to get more clear table picture in the pdf

-- coding: utf-8 --

""" Created on Wed May 6 17:40:01 2020

@author: yebarryallen 先要在cmd命令安装 如下 pip install pillow

""" #锐化 #用法教程:https://zhuanlan.zhihu.com/p/59656703 #https://www.cnblogs.com/Young-shi/p/11478732.html #https://pillow.readthedocs.io/en/stable/reference/ImageEnhance.html#PIL.ImageEnhance.PIL.ImageEnhance.Contrast ''' 发现先用smooth再用 contrast 效果不错 ''' from PIL import Image from PIL import ImageFilter im=Image.open('锐化2.png') bk=Image.open('timg.jpg') ''' im_1=im.convert('RGB').filter(ImageFilter.SMOOTH) im_2=im_1.convert('RGB').filter(ImageFilter.SMOOTH) im_3=im_2.convert('RGB').filter(ImageFilter.SMOOTH) im_4=im_3.convert('RGB').filter(ImageFilter.SHARPEN) ''' smooth=im.convert('RGB').filter(ImageFilter.SMOOTH) #sharpen=im.convert('RGB').filter(ImageFilter.SHARPEN) #smoothcover=im.convert('RGB').filter(ImageFilter.UnsharpMask(radius=2, percent=150, threshold=3))

from PIL import ImageEnhance im2=ImageEnhance.Contrast(smooth).enhance(3) ''' 这里为处理出来的表格打上背景 使得其更像自己画的一样 ''' im2.thumbnail((497,332),resample=Image.BICUBIC) #接下来可以进行背景图与高清图的融合 #网址https://blog.csdn.net/zhangziju/article/details/79123275 print(bk.mode,bk.size) print(im2.mode,im2.size) #调整背景图的大小 使用box box = (0,0,424,332) region = bk.crop(box) #最后一步 加上背景图 print(bk.mode,bk.size) print(im2.mode,im2.size) blend1=Image.blend(im2,region,0.2)

Jinquan Ye's Projects

covid-19 icon covid-19

Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE

lda-model icon lda-model

中文文本主题提取,并根据主题,对预测文本进行分类

pythonpachong icon pythonpachong

用了一下午终于搞好了一个爬虫,这个是从4399上爬取游戏(最后的保存没写)

tisoso icon tisoso

Django+爬虫实现一个在线题库搜索引擎(考试资料网/上学吧)

v2ray-heroku icon v2ray-heroku

用于在 Heroku 上部署 V2Ray Websocket,本项目不宜做为长期使用之对策。

weibonlp icon weibonlp

爬取热门微博评论并进行数据分析、nlp情感分析

yebarryallen icon yebarryallen

using python to get more clear table picture in the pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.