Unpacking Debit and Credit Spreads in Options

What's the difference between options debit and credit spreads?

In a Debit Spread, the investor experiences a net premium outflow by buying options at a higher price and selling options at a lower one. On the flip side, a Credit Spread is marked by a net premium inflow, where the investor buys options for less and sells for more.
 
For instance, if Mr. X initiates a Debit Spread by purchasing a call option for ₹7 and selling another for ₹5, he's out by ₹2. But in a Credit Spread, if he buys a call for ₹5 and sells another for ₹7, he gains a net of ₹2.