There's no way to know the exact relationship because there isn't an analytical solution for implied volatility. Intuitively, fromthe Black-Scholes equation:
$$
\begin{aligned}
C\left(S_t, t\right) & =N\left(d_{+}\right) S_t-N\left(d_{-}\right) K e^{-r(T-t)} \\
d_{+} & =\frac{1}{\sigma \sqrt{T-t}}\left[\ln \left(\frac{S_t}{K}\right)+\left(r+\frac{\sigma^2}{2}\right)(T-t)\right] \\
d_{-} & =d_{+}-\sigma \sqrt{T-t},
\end{aligned}
$$
increasing $r$ increases the price of the option, which results in an decrease in implied volatility as we need to keep the value of the option the same (like balancing an equation). (Which is why we observe this in your figures).
I think what you’re actually asking is how to “back-out” the $r$ and $q$ - affectively trying to find the implied-forward rate?
If the option is of the European type, you can calculate the forward using put-call parity on a put and call option with the same strike and expiration:
$$C - P = Se^{-qt} - Ke^{-rt}$$
If the option doesn’t pay a dividend, then just rearrange the equation for $r$. Otherwise, you can estimate $r$ using the guaranteed treasury bond rate and then back-out the dividend rate. If you don’t have an estimate for $r$ or $q$, you can’t really estimate either from just the face-value of the option because there are infinitely many different solutions for $r$ or $q$ that satisfy the put-call parity equation.
But again, this is merely an estimation and completely theoretical. From personal experience, because of the bid-ask spread, you can sometimes get unreasonable results like negative interest rates, 25% dividend rates etc. That doesn’t mean put-call parity is wrong, it’s just that the bid-ask spread is too big to give a good estimate of most metrics anyway.
Recently, I was backing-out the forward on ASX options, trying to gauge Australian interest rates. Some illiquid equities were resulting in negative interest rates, which is ridiculous, especially in current times of high interest-rates.