When some electrons of the electron beam pass through the specimen, what exactly happens after that in order to produce the black white image? What I understand is that electrons transmitted collide with a film and make that part of it black on the image, and those that don't collide make their part white. But why is it said that electrons that pass readily make the area brighter or more electron lucent and vice versa for scattered electrons?
The pixels in a TEM image are whiter or blacker based on the dose of electrons that impact that pixel in the whatever detector is being used to form the image, be that photographic film, a scintillation screen, or a direct detector camera.
As for how the image that reaches the detector is formed by the specimen being imaged, there are two different mechanisms.
Amplitude Contrast is relatively simple - denser parts of the specimen scatter electrons strongly enough that some electrons do not make it to the detector at all, so pixels below these parts of the specimen will receive a lower dose than pixels below less dense parts of the specimen.
Phase Contrast is more complex, and is responsible for most of the contrast in high-resolution cryo-TEM. Briefly, the specimen is illuminated by a parallel beam of electrons and every "pixel" of the specimen scatters some electrons but lets most of them pass straight through without interaction. The scattered electrons go off in a different direction than the main beam but are focused back by the lenses to the same point on the detector as the unscattered electrons. Because the scattered beam took a different path from the unscattered beam, and because electrons are waves as well as particles, there is a phase difference between the two beams which causes them to interfere. Typically, areas of the specimen that scatter electrons more will cause destructive interference, so darker pixels. If there is no scattering, then there is no interference, so brighter pixels. There are many resources explaining the technical details of this mechanism (1, 2, 3), but these tend to focus on crystalline specimens.