Twitter recently announced that 4K images can now be uploaded through their mobile app. If you update the app on either iOS or Android, you may see a setting that lets you upload 4K images. Previously, the limit was 2048×2048 or 2K images.
To get it enabled, head over to the app and go to Settings and Privacy>Data Usage> High Quality Image uploads and set your preference either to Mobile Data or Wi-Fi. Once done, images you upload will have lesser compression, therefore keeping nearly the same, if not the same quality of the image before it was uploaded into the app but also increases the file size and time it takes to upload, which also depends on your internet connection and size of the image.
If High Quality image uploads is disabled, 4K images would be compressed to just 2K images, and if enabled, the image will also be slightly compressed, thus reducing file size, but also retains the 4K image quality.
If uploading via web browser, then your image will be lossless, meaning there is no compression whatsoever and that file size and resolution are both maintained.
Also, in the mobile app, Twitter changed how images appear on the timeline. Previously, images are always in landscape regardless of the orientation, and the app used Machine Learning to generate an appropriate preview image that placed the subject in the window. With the new update, full images will be shown by default instead, which could cause some difficulty on tall images. With this in mind, Twitter is still testing out how tall images could appear in a single timeline.
There is no announcement yet for improved video quality and users are still stuck with 720p videos with aggressive compression.