Converting an image to black and white

This code is a project that I am working on to eventually analyze some images but right now I am purely trying to read an image and convert it to black and white. The input should be either white or something else which would end up as black so it is easy to check for this.

import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np  img = mpimg.imread('./Training/Image1.png')  imgplot = plt.imshow(img)  width = img.shape[1] height = img.shape[0]  def generateArray():     arr = []     for y in range(img.shape[0]):         arr.append([])         for x in range(img.shape[1]):             if img[y][x][0] != 1:                 arr[y].append(1)             else:                 arr[y].append(0)     return arr  arr = generateArray()  plt.show() 

To be clear, I desire to create an array arr that contains either a 0 if the corresponding pixel in the inputted image is white or 1 if it is anything other than white.

I am somewhat of a beginner with Python but I am confused as to why this code takes so long to run (>19 seconds on my older Mac). Is there something that I am missing that would speed it up significantly?

Black Friday Web Hosting Offers by Scopehosts

Black Friday Offers by Scopehosts

Get 50% Lifetime Offer on Netherlands 100TB Dedicated Servers* equipped with Intel Xeon E3-1230 | Intel Xeon E3-1240

Offer Code – SERVEROFFER

Netherlands 100TB Dedicated Servers
——————————————

Server Model : Intel E3-1230 4×3.2Ghz
RAM : 32 GB DDR3
Hard Drives : 4x4TB HDD
Bandwidth : 100TB
Port : 1Gbps
Location : Netherlands (Amsterdam)
IPv4 : 1
Discount Price : Euros 74.99 /month.

Server Model : E3-1240 4×3.2Ghz
RAM : 32 GB DDR3
Hard Drives : 4x4TB HDD
Bandwidth : 100TB
Port : 1Gbps
Location : Netherlands (Amsterdam)
IPv4 : 1
Discount Price : Euros 79.99 /month.

Get 20% Lifetime Discount on all Dedicated Servers

Offer Code : BLACKFRIDAY2017

Best of USA Dedicated Server Plans
======================================
Server Model : 1x Intel G850 ( HP DL120G7 | Dual-Core )
RAM : 4 GB DDR3
Hard Drives : 4x1TB HDD
Bandwidth : 10TB
Port : 1Gbps
Location : USA (Washington D.C)
IPv4 : 1
Price : Euros 44.99 /month

Best of Netherlands Dedicated Server Plans
======================================
Server Model : 1x Intel G850 ( HP DL120G7 | Dual-Core )
RAM : 4 GB DDR3
Hard Drives : 4x1TB HDD
Bandwidth : 10TB
Port : 1Gbps
Location : Netherlands (Amsterdam)
IPv4 : 1
Price : Euros 44.99 /month

Best of Germany Dedicated Server Plans
======================================
Server Model : 1x Intel G850 ( HP DL120G7 | Dual-Core )
RAM : 4 GB DDR3
Hard Drives : 4x1TB HDD
Bandwidth : 10TB
Port : 1Gbps
Location : Germany (Frankfurt)
IPv4 : 1
Price : Euros 44.99 /month

Best of Russia Dedicated Server Plans
======================================
Server Model : Core i3-560 (3.33Ghz)
RAM : 4 GB DDR3
Hard Drives : 2x 500 GB HDD
Port : 100Mbps
Location : Russia ( Moscow )
IPv4 : 1
Price : Euros 75.68 /month

Get 50% Onetime Discount on all Web Hosting Services plus Free Managed Support*

Offer Code : BLACKFRIDAY50

Note :
———–
* Free Managed Support is applicable on subscribing on annual basis

> Visit Scopehosts.com to explore more on Black Friday Offers

Live Support :
=================
24/7 Sales/Technical Ticket System Support
E-mail Support
Skype Messenger Support

Thank You.

Black Panther (2018) Dual Audio Hindi Full Movie Download HD

Download Full HD Movies Collection
https://mqsworldsite.blogspot.com/
Avengers: Infinity War(2018)Download HD Hindi Dubbed
http://www.mqsworldsite.blogspot.com/2018/06/avengers-infinity-war-2018-download-hd.html
Black Panther (2018) Dual Audio Hindi Full Movie Download HD
http://www.mqsworldsite.blogspot.com/2018/07/black-panther-2018-dual-audio-hindi.html
Deadpool 2 (2018) Hindi Dubbed Download…

Black Panther (2018) Dual Audio Hindi Full Movie Download HD

BLACK FRIDAY SALE 2018 – HOSTBAZZAR.COM!

BLACK FRIDAY SALE 2018 – HOSTBAZZAR.COM!

Make this Black friday special by earning special discount on linux shared, shared SSD, windows shared and linux reseller hosting services. Yes, Hostbazzar.com likes to offer 61% Off on all Linux Shared and Reseller Hosting plans. Also offering the Lifetime Discount with the shared and reseller hosting Plans and offering the below features too with these hosting plans :

================
– Instant Activation
– Free Setup
– No Hidden Charges
– Alerts and Notifications
– cPanel/whm control panel
– Softacolous Library
– Unlimited Bandwidth
– Unlimited Web Space
– Unlimited FTP Accounts
– Max Emails Per Hour
– Hassle Free Services
– 24×7 Hosting Chat Support
================
Start Date : 21st Nov 2018 – End Date : 31st Jan 2019
================
Promo Codes :-
================
HOSTBAZZARBFO18 : 61% Off With Linux Shared, Shared SSD & Linux Reseller Hosting
HOSTBAZZARBFL18 : 45% Lifetime Recurring Off With Linux Shared, Shared SSD & Linux Reseller Hosting
HOSTBAZZARBFA18 : 51% Recurring Off With Linux Application Hosting & Windows Shared Hosting
HOSTBAZZARBFU18 : 50% Off With Linux Unlimited Reseller Hosting

https://hostbazzar.com/

Regards
Sales Team
Hostbazzar.com

Tag: Half Dollar Hosting, Dollar 1 Hosting, $1 unlimited Hosting, cheap reseller Hosting, cheap ssd Hosting,

scan a lot of 35mm Black and white negatives

I have 4 binders filled with 35mm black-and-white negatives and contact sheets. I’ve had good luck scanning the contact sheets, but bad luck scanning the slides. Professional scanning services are 50 cents to $ 1.25/image. Apparently you don’t want to scan to B&W JPEG, because they are only 8-bits deep, but scanning to TIFF results in files that are 20-30 MB/image. And none of the home scanners are truly automatic, by which I mean that I can’t just put down the negatives on the scanner, hit a button, and end up with 10 decent scans.

I’ve also read that Digital ICE doens’t work with black-and-white negatives.

So what’s the right approach for scanning a lot of 35mm B&W negatives. I’m interested in preserving them and making them usable. My budget is $ 500 to $ 1000, and the scanning cost of the commercial scanners seems $ 5000 or more for the amount of images that I have.

Happy Thanksgiving from LowEndBox – Black Friday & Cyber Monday offers are coming!

Happy Thanksgiving to all of our readers at LowEndBox!

The 2018 Black Friday and Cyber Monday Hosting Deals are almost here, so remember to check Low End Box often for all the most exciting hosting, cloud and dedicated offers! We will be posting a set of EXCLUSIVE OFFERS on both BLACK FRIDAY and CYBER MONDAY so be sure to check back on both those days!

And as always be sure to check the deals posted on LowEndTalk: https://www.lowendtalk.com/categories/offers.

Follow us on Facebook to include the deals in your feed: https://www.facebook.com/lowendofficial

You can follow the deal stream for Low End Box on Twitter at @LowEndNetwork

We hope you all have a very Happy Thanksgiving!

[BLACK FRIDAY] TrunkSpaceHosting – 50% OFF all pricing!

Hey guys, Atif from TrunkSpaceHosting is back again this year with another aggressive offer for our readers. They are offering 50% off their regular pricing on the various plans listed below. They’re a registered company in Canada, their WHOIS is public, and you can find their legal docs/ToS here.

They accept the following payment methods: PayPal, Stripe, BTC, BCH, ETH and LTC via Coinbase Commerce, PaymentWall for gift cards and bank transfers in many countries.

In their own words: 

“Our company (TrunkSpace Hosting) was founded in February of 2005, starting up by providing shared and dedicated website hosting for small and medium businesses on dedicated servers out of Portland, Oregon. We have since expanded our offering to include VPN solutions, VPS solutions, voice servers (with Teamspeak 3, for which we became an ATHP, and Mumble, for which we are on the official Mumble hoster list) in July 2013; we now have voice servers hosted out of 12 locations worldwide, hosting over 1000 voice servers (over 20,000 total slots). We now provide game servers (for games: Arma 3, Battlefield 2, CS:GO, CS:Source, GTA-MTA, GTA-SA, Minecraft & Team Fortress 2), as well as dedicated servers, and we sell SSL certificates at ultra low prices.

Our VPS service expands our service offering further, with nodes (OpenVZ & KVM) in Jacksonville, Florida, and nodes (OpenVZ & KVM) in Los Angeles, California.

We were incorporated in the province of Quebec in September 2015, and are now known as TrunkSpace Hosting Inc. We own servers in our Montreal datacenter, the city where we are headquartered, colocate servers used for webhosting some of our dedicated hosting services, while we lease and remotely operate servers for the rest of our offerings.”

The offers: 

OpenVZ BRONZE

  • 1 CPU Cores @ 2.00+ GHz
  • 1GB Memory
  • 25GB Disk Space
  • 1000GB Bandwidth
  • OpenVZ
  • $ 2.47/mo
  • [ORDER]

OpenVZ SILVER

  • 2 CPU Cores @ 2.00+ GHz
  • 2GB Memory
  • 50GB Disk Space
  • 2000GB Bandwidth
  • OpenVZ
  • $ 3.97/mo
  • [ORDER]

OpenVZ GOLD

  • 3 CPU Cores @ 2.00+ GHz
  • 4GB Memory
  • 100GB Disk Space
  • 3000GB Bandwidth
  • OpenVZ
  • $ 5.97/mo
  • [ORDER]

KVM BRONZE

  • 1 CPU Cores @ 2.00+ GHz
  • 1GB Memory
  • 25GB Disk Space
  • 1000GB Bandwidth
  • KVM
  • $ 2.47/mo
  • [ORDER]

KVM SILVER

  • 2 CPU Cores @ 2.00+ GHz
  • 2GB Memory
  • 50GB Disk Space
  • 2000GB Bandwidth
  • KVM
  • $ 3.97/mo
  • [ORDER]

KVM GOLD

  • 3 CPU Cores @ 2.00+ GHz
  • 4GB Memory
  • 100GB Disk Space
  • 3000GB Bandwidth
  • KVM
  • $ 5.97/mo
  • [ORDER]


NETWORK INFO:

NeedaServer.net DC out of Los Angeles, California, USA
Test IPv4: 68.64.160.66

ServerComplete DC out of Jacksonville, Florida, USA
Test IPv4: 23.239.84.130


Host node specifications:
Jacksonville, Florida:
All VPS Nodes (OpenVZ & KVM) each have:
– 2x Intel Xeon X5650 CPU
– 48GB RAM
– 4x 1TB HDDs
– Hardware RAID10
– 1Gbps uplink

Los Angeles, California:
All VPS Nodes (OpenVZ & KVM) each have:
– 2x Intel Xeon X5650 CPU
– 48GB RAM
– 2x 2TB HDDs
– Hardware RAID1
– 1Gbps uplink

[BLACK FRIDAY] TrunkSpaceHosting – 50% OFF all pricing!

Hey guys, Atif from TrunkSpaceHosting is back again this year with another aggressive offer for our readers. They are offering 50% off their regular pricing on the various plans listed below. They’re a registered company in Canada, their WHOIS is public, and you can find their legal docs/ToS here.

They accept the following payment methods: PayPal, Stripe, BTC, BCH, ETH and LTC via Coinbase Commerce, PaymentWall for gift cards and bank transfers in many countries.

In their own words: 

“Our company (TrunkSpace Hosting) was founded in February of 2005, starting up by providing shared and dedicated website hosting for small and medium businesses on dedicated servers out of Portland, Oregon. We have since expanded our offering to include VPN solutions, VPS solutions, voice servers (with Teamspeak 3, for which we became an ATHP, and Mumble, for which we are on the official Mumble hoster list) in July 2013; we now have voice servers hosted out of 12 locations worldwide, hosting over 1000 voice servers (over 20,000 total slots). We now provide game servers (for games: Arma 3, Battlefield 2, CS:GO, CS:Source, GTA-MTA, GTA-SA, Minecraft & Team Fortress 2), as well as dedicated servers, and we sell SSL certificates at ultra low prices.

Our VPS service expands our service offering further, with nodes (OpenVZ & KVM) in Jacksonville, Florida, and nodes (OpenVZ & KVM) in Los Angeles, California.

We were incorporated in the province of Quebec in September 2015, and are now known as TrunkSpace Hosting Inc. We own servers in our Montreal datacenter, the city where we are headquartered, colocate servers used for webhosting some of our dedicated hosting services, while we lease and remotely operate servers for the rest of our offerings.”

The offers: 

OpenVZ BRONZE

  • 1 CPU Cores @ 2.00+ GHz
  • 1GB Memory
  • 25GB Disk Space
  • 1000GB Bandwidth
  • OpenVZ
  • $ 2.47/mo
  • [ORDER]

OpenVZ SILVER

  • 2 CPU Cores @ 2.00+ GHz
  • 2GB Memory
  • 50GB Disk Space
  • 2000GB Bandwidth
  • OpenVZ
  • $ 3.97/mo
  • [ORDER]

OpenVZ GOLD

  • 3 CPU Cores @ 2.00+ GHz
  • 4GB Memory
  • 100GB Disk Space
  • 3000GB Bandwidth
  • OpenVZ
  • $ 5.97/mo
  • [ORDER]

KVM BRONZE

  • 1 CPU Cores @ 2.00+ GHz
  • 1GB Memory
  • 25GB Disk Space
  • 1000GB Bandwidth
  • KVM
  • $ 2.47/mo
  • [ORDER]

KVM SILVER

  • 2 CPU Cores @ 2.00+ GHz
  • 2GB Memory
  • 50GB Disk Space
  • 2000GB Bandwidth
  • KVM
  • $ 3.97/mo
  • [ORDER]

KVM GOLD

  • 3 CPU Cores @ 2.00+ GHz
  • 4GB Memory
  • 100GB Disk Space
  • 3000GB Bandwidth
  • KVM
  • $ 5.97/mo
  • [ORDER]


NETWORK INFO:

NeedaServer.net DC out of Los Angeles, California, USA
Test IPv4: 68.64.160.66

ServerComplete DC out of Jacksonville, Florida, USA
Test IPv4: 23.239.84.130


Host node specifications:
Jacksonville, Florida:
All VPS Nodes (OpenVZ & KVM) each have:
– 2x Intel Xeon X5650 CPU
– 48GB RAM
– 4x 1TB HDDs
– Hardware RAID10
– 1Gbps uplink

Los Angeles, California:
All VPS Nodes (OpenVZ & KVM) each have:
– 2x Intel Xeon X5650 CPU
– 48GB RAM
– 2x 2TB HDDs
– Hardware RAID1
– 1Gbps uplink