If the platform is not open-source, is the computer program copyrightable?
All computer programs are not just copyrightable, they are protected by copyright as soon as they are put into fixed form (for example, as soon as I type it on my computer which will save it as a file on a disk). The copyright owner doesn't have to take any actions whatsoever to have a computer program protected by copyright. It’s not just computer programs, even many fonts are copyrighted because they are essentially computer programs.
BTW. What I just wrote is also protected by copyright. There are some licenses involved that I agreed to when I submitted it to this website, and which allow the website to publish and you to read this text, but I'm the copyright holder.
PS. There is a comment saying “computer programs are not literary works and therefore not copyrightable”. That may have been true or arguable in the 1980’s. It’s not true now.
PS. No, stack exchange doesn’t own the copyright to my post, I do. Unless I was an employee of the company and posted on their behalf. Stack exchange needs and has a license to publish this post.
Except for limited circumstances, all computer programs are protected by copyright (an exception would be a program created by the US government). Therefore, to overcome copyright protection, the creator must grant a license to others to use and redistribute software with some specified degree of freedom. This is what gave rise to the myriad open source licenses. "Platform" might mean, e.g., distribution repository, operating system, or hardware. I don't know of any effective restriction (open vs. closed) on software copyright related to OS or hardware, but it is easy to limit distribution repositories so that, for example, "by uploading a program you grant any user total freedom to use and re-sell your software" or "by uploading a program you grant the repository an unlimited license to do what they want" (not actually good licenses, just there to illustrate the possibilities).
In addition to the copyright itself as answered in the other answers, it is worth noting that while the code itself falls under copyright, WHAT the program does is usually not part of the copyright.
Thus if you have implemented a program A to read data from an image and search for specific patterns in it your program itself is protected.
BUT if someone has a similar idea on how to do things, or manages to read your program code and then use that to implement program B which does the same thing (only with a slightly different code), this is normally NOT protected by the "automatic" copyright of program A (as it was not program A that was copied, but B consists only of code that has the same "idea" and "result" not the same "way").
This is at least the case within the EU. IF it is the same anywhere else (US as example) I'm not aware of.
It depends on what you mean by "computer program".
If you're referring to the algorithm that the computer operates, no, you can't copyright it, because it's a process or a system of rules, and those can't be copyrighted. However, if you're talking about the specific expression of an implementation of that process, then that can be copyrighted.
So, for instance, I could find an open source program that was implemented in Java, study it, then code my own proprietary version in Python that implements the exact same algorithms and procedures in a different language, and that wouldn't violate copyright. This has been done a number of time in the pen-and-paper RPG space, for instance - there have been a number of different retroclones of different editions of Dungeons and Dragons that use new wordings to express the same rules without violating copyright.