The number of pixels in one megabyte depends on the color mode of the picture. For an 8-bit (256 color) picture, there are 1048576, or 1024 X 1024 pixels in one megabyte. This can be calculated using the file size calculator provided by the Northern Arizona University.
For a 16-bit (65536 colors) picture, one megabyte contains 524288 (1024 X 512) pixels. For a 24-bit RGB (16.7 million colors) picture, one megabyte has approximately 349920 (486 X 720) pixels. For a 32-bit CYMK (16.7 million colors) picture, one megabyte has 262144 (512 X 512) pixels. For a 48-bit picture, one megabyte has only 174960 (486 X 360) pixels.