Can I use my Iphone 7 camera to take my canadian visa picture?

These are the requirements:
-Digital dimensions are often expressed in pixels or DPI (dots per inch). The physical dimensions in pixels must be at least 420 x 540
-The image must be in colour (24 bits per pixel) in RGB colour space

No chance.

Go get a proper passport photo.

Yes. You will need some simple photo editing to size the image properly (crop and image scaling). JPEG images, which your phone uses and what the visa agency will expect if you submit in digital form, is in 24-bit colour space.

If you can use window light (look up window light if you don't understand this concept) to illuminate your face with a plain background (wall with a solid neutral color), you will have good results.

Yes, but be certain to know ALL of the specific rules and regulations regarding a passport. In the US, for example, not only must the photo be of a very specific size, but the length from the base of the chin to the top of the head must also be of a very specific length. In addition, there can't be any shadows behind the person's head.

So, yeah, if you follow ALL of the rules and regulations, you can easily use a smartphone to take a passport photo. Just be sure to submit your passport application well in advanced. Your application may get rejected, and if so, you will need to redo the image and wait another 4-6 weeks to have the application approved. It's quite possible that you will need 8-12 weeks to get your passport if your first application is denied due to your failure to comply with the photo regulations. This could result in you not getting a passport in time for your expensive trip - all because you wanted to save $15-$20 on a passport photo. In the big picture, $20 is nothing compared to what you're spending on a international trip.