Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
If using Thonny, go to Tools -> Manage Packages, then enter cs20-image
. This should install both the image module, and the Pillow module (so you can use any type of image you'd like).
If you are not using Thonny, copy image.py to your site-packages directory, or just keep it in the same folder as the Python scripts that import it.
This image library is not going to give you fancy high performance operations on images. It allows you to read in an image and manipulate its pixels. Then you can save the new image to a file, or you can display the image in a window. Thats really about it, but its really all you want to do if you are teaching an introductory computer science course.
If you have PIL installed on your system (if you are using Thonny, this was installed along with the image module):
If you do not have PIL installed then you are stuck with GIF images only.
::
import image
win = image.ImageWin(480, 640, "Image Processing")
original_image = image.FileImage('lcastle.gif')
width = original_image.get_width()
height = original_image.get_height()
print(width, height)
original_image.draw(win)
my_image = original_image.copy()
for row in range(height):
for col in range(width):
v = my_image.get_pixel(col,row)
v.red = 255 - v.red
v.green = 255 - v.green
v.blue = 255 - v.blue
my_image.set_pixel(col,row,v)
my_image.draw(win)
print(win.get_mouse())
my_image.save('lcastle-inverted.gif')
print(my_image.to_list())
win.exit_on_click()
FAQs
Image manipulation library for media computation education
We found that cs20-image demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.