GSOC 2024: Add options for cover art processing

Add options for cover art processing

Proposed Mentors: outsidecontext / zas
Languages/skills: Python / Image processing
Estimated Project Length: 350 hours
Expected Outcomes:

Following new features in Picard:

  1. Provide an option to designate a preferred shape and format for cover art images. If not specified, automatically convert images to the preferred shape and format. Additionally, ignore images smaller than a specified width and height, and resize images larger than the maximum width and height to fit within those dimensions.
  2. Implement functionality for users to manually adjust the preferred shape, format, and size of cover art images.
  3. An image post-processing plugin hook, allowing plugins to perform additional manipulations on cover art images.

Personal Information

Name: Shubham Bhut

IRC Nick - Shubham

Email: shubhamprecious1@gmail.com

Discord: Discord

Country of Residence: India

Time zone: IST (GMT + 05:30)

GitHub: ShubhamBhut (Shubham Patel) · GitHub

LinkedIn: https://www.linkedin.com/in/shubham-patel01/

Proposed Solution

  • Qimage class of Qt should be chosen for image processing as it avoids any new dependency, and is sufficient to handle all the processing work.

  • The alternate options for image processing are pillow and opencv.

  • However, the processing speed of QImage seems to be on par with opencv and significantly better than of pillow. And since opencv is a very heavy dependency, it would be advisable to use the QImage.

  • It is advisable to keep the code of image processing in a separate file (rather than just adding into picard/coverart/image.py), for convenience in future changes and improvements.

  • Since It is mentioned in the project description that project focus on post process cover art images provided by (and independent of) the providers, so that would be primary focus, though support for the images from saved files can be later added.

Features regarding Cover Art shape and format

  • The image’s current data can be easily fetched from CoverArtImage class’s self.data, self.width and self.height.

  • Using QImage’s scaled() method, the image’s shape can be manipulated.

  • Therefore a new method can be added which will allow detection and scaling of the cover-art image.

  • Similarly the self.mimetype can be used to detect the cover-art image’s current format

  • And QImage’s convertToFormat() method can be used to change the format of an image.

  • Use of multithreading for faster image processing is proposed

UI wise

  • Introduce new checkbox options within the options menu to enable users to set default image shape and type preferences conveniently.

  • Implement a feature where users can access manual image processing options by right-clicking on the cover art thumbnail.

Image post processing Plugin hook

  • A new post processing hook would be added which will allow plugin developers to do additional image manipulations after processing and before the file is saved.

  • Multiple hooks based on save settings or cover art sources seems unnecessary. Moreover, the existing PluginPriority feature allows plugin developers to set the correct order of the plugins’ processing.

Timeline

  • Pre-Community Bonding Period: Working on issue(s) regarding plugins or cover art to get a better idea of plugin development and hooks.
  • Community Bonding Period - Discuss the solution with mentor and make any changes if needed
  • Week 1&2: Implement methods for image reshaping and format conversion
  • Week 3&4: Make the implemented methods faster with graceful multiprocessing
  • Week 5: Finish the UI work
  • Week 6: Develop the plugin hook
  • Week 7&8: Testing and Finishing
  • Week 9: Community Feedback period
  • Week 10: If any final changes are required
  • Week 11&12: Buffer period (May work on a plugin if the project is finished)

Community affinities

What type of music do you listen to? (please list a series of MBIDs as examples)

I divide my music into 2 categories based on mood: Relax and Pop.

  • Relax includes mainly classics pieces and ambient music (including soundtracks), some favourites:
  1. The Nutcracker suite by Tchaikovsky
  2. Aine klaine natschmusic by Mozart
  3. Waltz of the stars by Alex Lamotte
  • Pop for me includes generally pop, sometimes metal and rarely rap, some favourites:
  1. Style by Tylor swift
  2. Different world by Alan walker
  3. Christmas Truce by Sabaton

What aspects of MusicBrainz/ListenBrainz/BookBrainz/Picard interest you the most?

  • To be honest, I wasn’t even aware about the concept of audio tagging before GSoC. I came to know about this amazing concept of audio/music files management through picard. It felt fairly easy and convenient to use for a newcomer like me. I really liked plugin support (I am a big fan of plugins). I liked the idea of troi, but haven’t dived deep into its code yet.

Have you ever used MusicBrainz Picard to tag your files or used any of our projects in the past?

  • I recently (in early February) started using Picard when I first came to know about audio tagging. I haven’t dived too deep into it but I have player around with it and have used it for my old downloaded songs collection. And I liked it so much that I changed my primary project from a ML based project to this project.

Programming precedents

When did you first start programming?

  • I started programming almost 3 years ago (in the second semester of my university). I actually had joined our college discord server and I was impressed by a bot developed by my friend. I started python as a hobby and developed some interesting projects. During my second year of college I dived into Data Science and went too deep. During my third year of college I explored various other domains such as rust and block chain development. At that time I decided to make programming my career.

Have you contributed to other open source projects? If so, which projects and can we see some of your code?

Apart from picard, I have rarely contributed into open source, but some of them includes:

  1. The eye of Satoshi
  2. NKSSS

What sorts of programming projects have you done on your own time?

  • Feel free to check out my github. Some notable projects I would suggest are:
  1. Elder scroll universe name generator
  2. Bonds_rs
  3. Blockchain development

Practical requirements

My Development setup

  • I use my dual booted Dell G5 SE (NixOS and Windows 10) with Ryzen 7 4800H CPU, Radeon RX 5600M GPU and 16GB RAM.
  • For programming I generally prefer the NixOS setup (Neovim for code editing, fish shell and hyprland window manager). Though I sometimes also use windows (VS Code) for development.

Availability

  • During the GSoC development period, I will be on my summer vacation period. I will have no other engagement during this time and therefore I will be able to give around upto 40 hours per week to this project.