Information Theory and Thermodynamics of Light Part II. Principles of Information Thermodynamics