Since its birth, Krita has been depending on ImageMagick (or the GraphicsMagick fork). The original idea was to build Krita as a GUI on top of ImageMagick. When the current team (or at least its veterans) started to work on Krita, ImageMagick was only used for exporting and importing files.
But using an abstraction of file formats did not give us enough control on how the files are loaded and saved, so four years ago, we decided to have our own implementation of the most used file formats: png, jpeg and tiff. Then later, tired of having to adjust our code for each releases of ImageMagick, we turned to GraphicsMagick, a fork that claim to have API stability. But the long term plan has always being to remove the dependency, and to have our own implementation of the file formats (or to use libraries when relevant).
Things have been accelerated recently, when we discovered that recent version of GraphicsMagick crashes Krita in a very weird way, so we decide to remove the GraphicsMagick files filter, and to finish implementing the format ourselves. This has started with the PPM filter that was finished yesterday, and now I am taking care of the JPEG 2000 format using the OpenJpeg library. But this might mean that in the near future, some important file format such as Photoshop‘s PSD or Gimp‘s XCF will not be available (but there is a Gimp plug-in to export to ORA which can then be imported in Krita).