I text the correct combo of ones and zeros I recently listed to the song I'm a Textpert about texting while driving and one particular line in the song inspired this challenge.


  I never stoop so low as to text photos / Instead I text the correct combo of ones and zeros


Now obviously, this would be an almost impossible thing to do in ones head and so you should help textperts world wide by coding a program to do the same thing.

Your job is to take the name of an image file with the dimensions 500x500 pixels and output the file as binary. You may also take an image as input, if you language supports it.

You may use image files with the extensions


.jpg
.png
.gif
.bmp
.svg


Allow me to demonstrate how to convert an image into binary, for those who don't understand what I mean.

Step 1

Take the first pixel in the file and retrieve its RGB value as 3 decimal numbers: R, G and B. Let's assume, for example, that the first pixel is 255,0,0 (red).

Step 2

Convert each number into its 8-bit binary representation and concatenate into a single 24-bit number. For the example, this yields 111111110000000000000000

Step 3

Add this 24-bit number to the final output. Therefore, the final output should be 6000000 digits long and should consist of entirely 1 and 0

This is a code-golf so shortest code wins!
Pyth, 14 13 bytes

-1 byte thanks to Erik the Outgolfer (z can be removed for implicit input).

sm.[\08.Bd.n'


Explanations

sm.[\08.Bd.n'

            '    # Open the path/URL given as implicit input. Return list of color triples for color images: [(255, 125, 23), ...]
          .n     # Flatten the list
 m     .Bd       # For each element of the list, convert to binary
  .[\08          # Pad with zeros on the left up to 8 characters
s                # Concatenate the list of bytes


Unfortunately, because of safety reasons, that cannot be tested with the online interpreter; you will have to clone Pyth to test it on your own computer.