image

Print image on socket Termal printer (Python)

Print image on socket Termal printer (Python) Question: I’m trying to create a python script to print an image on my network connected thermal printer, through a socket connection. I tried this script but instead of printing the image it prints an infinite string of characters: import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(("192.168.1.56", 9100)) with …

Total answers: 1

Python AttributeError: 'numpy.ndarray' object has no attribute 'append'

Python AttributeError: 'numpy.ndarray' object has no attribute 'append' Question: I am trying to parse a folder with contains csv file (These csv files are pixel images position) and store them into a numpy array. When I try to perform this action, I have an error: AttributeError: ‘numpy.ndarray’ object has no attribute ‘append’. I understand that …

Total answers: 3

How can I make pdf2image work with PDFs that have paths containing Chinese characters?

How can I make pdf2image work with PDFs that have paths containing Chinese characters? Question: Following this question, I tried to run the following code to convert PDF with a path that contains Chinese characters to images: from pdf2image import convert_from_path images = convert_from_path(‘path with Chinese character in it/some Chinese character.pdf’, 500) # save images …

Total answers: 1

How to check if an image is "JPEG 2000" in Python?

How to check if an image is "JPEG 2000" in Python? Question: How to check if an image file is JPEG 2000 in Python? If possible, without installing a heavy image library. Asked By: Marcel || Source Answers: If the image is stored as a file, you can check if it starts with the JPEG …

Total answers: 1

Add white background and resize images in a folder

Add white background and resize images in a folder Question: I want to add a white background to my transparant images (png) and resize them. The images are located in a folder. I need to do bulk work, not 1 image at the time. I removed the background from the images first with rembg (works …

Total answers: 1

How to import png images Turtle Python

How to import png images Turtle Python Question: I cannot import png images into python turtle although I can add gif images. Can someone please answer this as quickly as they can. I tried just swapping to png from the gif, but no luck. Asked By: Urbro49 || Source Answers: The turtle module does not …

Total answers: 1

How to set name for download images

How to set name for download images Question: I think I need help with for loop. I have a list of 33 images. For each image I need to create a name: name, reference and number. Every product with the same reference number has to ends with number from 1 to …x *Like her: Can …

Total answers: 3

Image not showing in tkinter button

Image not showing in tkinter button Question: I created a button with an image in Tkinter, but the image isn’t showing, i can just see a blank space in the button. Maybe my OS is the problem. I have Linux Mint 21 Xfce Edition. from tkinter import ttk from tkinter import filedialog from tkinter import …

Total answers: 1

How to edit metadata from .svs Aperio whole slide image?

How to edit metadata from .svs Aperio whole slide image? Question: I have whole slide images, in .svs format, that have be digitized with Leica aperio scan. Thanks to openslide package (https://openslide.org/), I figured out that those .svs files contain a lot of metadata, especially the ‘Filename’ that can contain patient-related information. I would like …

Total answers: 1

How do I create image from binary data BSQ?

How do I create image from binary data BSQ? Question: I’ve got a problem. I’m trying create image from binary data which I got from hyperspectral camera. The file which I have is in BSQ uint16 format. From the documentation I found out that images contained in the file (.dat) have a resolution of 1024×1024 …

Total answers: 1