Skip to main content

This is a module that can turn a picture into a pattern of letters and symbols.

Project description

photototext module is built on the basis of PIL and Numpy. It is simple and has only one function: change. It can open all kinds of pictures such as jpg, png, gif and so on that are supported by PIL. Then it will change the picture into a graph composed of characters and signs. Finally, the result will be returned as a string type. The introduction to this function change is as follows:

Function change has one parameter: file. It can automatically compress the change the picture once the path of the picture has been input to file. The result is a new graph composed of characters and signs.

For example, there is a jpg type of logo picture of Python at D(D:\python.jpg). The changing of the picture can be realized by typing:

import photototext as pt

text = pt.change('D:\python.jpg')

print(text)

The result is as follow:

                                                                                      ...;;;---------;;;;..                                                                                         
                                                                              .;-:!>>77??????CCCCCCCC??????77>>!:-;.                                                                                
                                                                        .;-!>7??CCCC??????????????????????????CCCC??7>!-;                                                                           
                                                                     ;:>7?CC??????????????????????????????????????????CC?7>:;                                                                       
                                                                  ;!7?C???????????????????????????????????????????????????CC?7:;                                                                    
                                                               .:7?C??????????????????????????????????????????????????????????C?>-                                                                  
                                                              -7C???????CC????CC????????????????????????????????????????????????CC7;                                                                
                                                             >C???????C7!-;;;;-!7C??????????????????????????????????????????????????:                                                               
                                                            >C????????:.        .:??????????????????????????????????????????????????C:                                                              
                                                           -C????????-            -???????????????????????????????????????????????????.                                                             
                                                           :C???????7              >?????????????????????????????????????????????????C-                                                             
                                                           :C????????.            .7?????????????????????????????????????????????????C-                                                             
                                                           :C????????>.          .>??????????????????????????????????????????????????C-                                                             
                                                           :C?????????7:;      .:7C??????????????????????????????????????????????????C-                                                             
                                                           :C??????????C?7>!!>7?C????????????????????????????????????????????????????C-                                                             
                                                           !C?????????????CCCC???????????????????????????????????????????????????????C-                                                             
                                                           :C????????????????????????????????????????????????????????????????????????C-                                                             
                                                           !C????????????????????????????????????????????????????????????????????????C-                                                             
                                                           :?77777777777777777777777777777777777?????????????????????????????????????C-                                                             
                                                            ................................... -????????????????????????????????????C-                                                             
                                                                                                -C???????????????????????????????????C-                                                             
                                .;:!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>7????????????????????????????????????C-   .;;;;;;;;;;;;;;;;;;;;..                                   
                              ->??CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC?????????????????????????????????????C-   ;:----------------------;.                                
                            :7C??????????????????????????????????????????????????????????????????????????????????????????????????????C-   ;--------------------------.                              
                          -7C????????????????????????????????????????????????????????????????????????????????????????????????????????C-   ;---------------------------;.                            
                         !????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;-----------------------------.                           
                        >C????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;------------------------------;                          
                       >C?????????????????????????????????????????????????????????????????????????????????????????????????????????????;   ;-------------------------------;                         
                      !C??????????????????????????????????????????????????????????????????????????????????????????????????????????????.   ;--------------------------------.                        
                     :C??????????????????????????????????????????????????????????????????????????????????????????????????????????????7.   ;---------------------------------.                       
                    .???????????????????????????????????????????????????????????????????????????????????????????????????????????????C!    ;----------------------------------                       
                    !C???????????????????????????????????????????????????????????????????????????????????????????????????????????????.    -----------------------------------;                      
                   ;????????????????????????????????????????????????????????????????????????????????????????????????????????????????-    ;------------------------------------                      
                   !C??????????????????????????????????????????????????????????????????????????????????????????????????????????????-    ;-------------------------------------.                     
                   7????????????????????????????????????????????????????????????????????????????????????????????????????????????C>.    ;--------------------------------------;                     
                  ;???????????????????????????????????????????????????????????????????????????????????????????????????????????C7:    .-----------------------------------------                     
                  :C???????????????????????????????????????????????????????????????????????????????????????????????????????C?>:     ;------------------------------------------.                    
                  !C????????????????????????????????????????????????????????????????????????????????????????CCCCC?C?CCCC??>:;     ;--------------------------------------------.                    
                  >C?????????????????????????????????????????????????CCC???7777777777777777777777777>>>>>>>>>>>>>>>>>!!:;.     .;----------------------------------------------;                    
                  >??????????????????????????????????????????????CC?7!:-;...                                                .;;------------------------------------------------;                    
                  >????????????????????????????????????????????C?>-.                                                 ....;;----------------------------------------------------;                    
                  >???????????????????????????????????????????7:.     ..;;-----------------------------------------------------------------------------------------------------;                    
                  !????????????????????????????????????????C7-     .;----------------------------------------------------------------------------------------------------------.                    
                  :C???????????????????????????????????????:    .;-------------------------------------------------------------------------------------------------------------.                    
                  ;??????????????????????????????????????7;    ;---------------------------------------------------------------------------------------------------------------                     
                   7????????????????????????????????????7.   .----------------------------------------------------------------------------------------------------------------;                     
                   !C???????????????????????????????????;   .-----------------------------------------------------------------------------------------------------------------.                     
                   .???????????????????????????????????7    ------------------------------------------------------------------------------------------------------------------                      
                    !C????????????????????????????????C>   .-----------------------------------------------------------------------------------------------------------------.                      
                    .?????????????????????????????????C!   .-----------------------------------------------------------------------------------------------------------------                       
                     -?????????????????????????????????!   .----------------------------------------------------------------------------------------------------------------.                       
                      !C??????????????????????????????C!   .---------------------------------------------------------------------------------------------------------------.                        
                       >C?????????????????????????????C!   ;--------------------------------------------------------------------------------------------------------------;                         
                        !C????????????????????????????C!   ;-------------------------------------------------------------------------------------------------------------;                          
                         :????????????????????????????C:   ;------------------------------------------------------------------------------------------------------------.                           
                          ;7C?????????????????????????C:   ;----------------------------------------------------------------------------------------------------------;.                            
                            -7CC???????????????????????:   ;--------------------------------------------------------------------------------------------------------;.                              
                              ->7?CCCCCCCCCCCCCCCCCCC?C!   ;------------------------------------------------------------------------------------------------------;.                                
                                .;-:!!>>>>>>>>>>>>>>>>>-   ;-------------------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..                                   
                                                           ;-------------------------------------                                                                                                   
                                                           ;-------------------------------------                                                                                                   
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;--------------------------------------------------------------------------.                                                             
                                                           ;-------------------------------------------------------;;;;;--------------.                                                             
                                                           ;----------------------------------------------------;.       .;-----------.                                                             
                                                           ;---------------------------------------------------;            ----------.                                                             
                                                           ;--------------------------------------------------;             .---------.                                                             
                                                           ;--------------------------------------------------;              ---------.                                                             
                                                           .---------------------------------------------------.            ;---------.                                                             
                                                            ;---------------------------------------------------.         .;---------;                                                              
                                                             ;----------------------------------------------------;;....;;----------;                                                               
                                                              .--------------------------------------------------------------------.                                                                
                                                                .---------------------------------------------------------------;.                                                                  
                                                                  .;----------------------------------------------------------;.                                                                    
                                                                     .;;--------------------------------------------------;..                                                                       
                                                                         ..;;----------------------------------------;;..                                                                           
                                                                               ...;;;------------------------;;;...                                                                                 
                                                                                         ................                                                                                           

Note: The graphics you see may be distorted,use “宋体” of “Terminal” fonts to see the result.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photototext-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

photototext-0.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file photototext-0.0.1.tar.gz.

File metadata

  • Download URL: photototext-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.1

File hashes

Hashes for photototext-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8273b82f9ad0391f14c592da26f591f21a084498013d4846b216a14a8ac6b6a8
MD5 8b955dabf87f0d9a8be51377883b2e81
BLAKE2b-256 00365daa96c90292dad86bef144826c569ddc1f95a9fc8b4edafc4cecb5aab6e

See more details on using hashes here.

File details

Details for the file photototext-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: photototext-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.1

File hashes

Hashes for photototext-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e32c42c5f244bd23bb5e029d7bb4c99598f7c30560af12af1f6be6ea5034aeb
MD5 5e1b39a08646c09729a45e0bae991610
BLAKE2b-256 001ec4d16ac913a51ebcff5273dced5c4f9b07edc3162e5e22976d85bce9aaa0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page