Is it acceptable to write a scientific paper on an algorithm if better algorithms already exist? Long story short, I designed a compression algorithm that performs well compared to some other compression algorithms.

I was wondering if it's acceptable to write a scientific paper on this algorithm even though there exist other algorithms which are faster and provide better compression ratios compared to mine.

Note: I've never written a scientific paper and am no longer in academia.
Yes. You can't tell before performing the research if the algorithm will be better than old ones. Now that you've done it and found the answer is "no", that's still a result. It won't be the most interesting of results so you won't be able to publish it in top journals, but it's still something.

As an example, see the iterated prisoner's dilemma. There's a simple, robust strategy discovered early on: tit-for-tat. However, people continued to study other strategies - a close parallel to your situation.