1 Introduction

Ibuprofen is a widely used non-steroidal anti-inflammatory drug with analgesic properties, commonly prescribed and available as an over-the-counter product in tablet form. The active pharmaceutical ingredient (API) 2-(4-isobutylphenyl) propanoic acid consists of a phenolic ring and a propionic acid side chain, which functions as a non-selective cyclooxygenase-2 (COX-2) inhibitor to reduce inflammation [1, 2].

Different analytical approaches for the quality control of ibuprofen are recommended by pharmacopoeia, including spectrophotometry, gas chromatography and high-performance liquid chromatography [1, 3]. While these methods provide high precision, instrumental acquisition is expensive and requires trained personnel, limiting in situ and low-cost rapid testing of pharmaceuticals. Thin-layer chromatography (TLC) provides an inexpensive and highly efficient method for the qualitative determination of various drugs. Although this method can be extended using mass spectrophotometers and densitometers, these instruments are expensive and not readily available [4, 5].

In recent years, smartphone camera systems have undergone rapid development, leading to improvements in sensor sizes, more sophisticated image stabilisation and on-device image processing. Consequently, these systems can now capture high-quality images, both quickly and reliably [6, 7]. As an alternative to expensive instrumental testing methods, the use of smartphone cameras for analytical methods has been investigated by several research teams. For one, Mac Fhionnlaoich et al. [8] presented the “qTLC” toolkit for the quantification of TLC plates under and without ultraviolet (UV) illumination, providing supplementary information for taking images as well as the implementation in the curricula. In 2022, Hauk et al. [9] presented an open-source app “TLClyzer” to quantify the content of 14 different active pharmaceutical ingredients (APIs) in pharmaceutical preparations, following recommended methods from the Global Pharma Health Foundation (GPHF) MiniLab for developing countries. A different approach is presented, comparing the usage of a densitometer to the digital analysis of iodine-stained plates, measuring luminance using a colorimetric smartphone app [10]. These approaches can provide a reliable determination of certain drugs. However, their use is limited to the single purpose of analysing TLC plates.

Compared with previously mentioned methods, Fiji, an open-source software for image processing and analysis for scientific purposes based on ImageJ, with additional packages for advanced image analysis, offers a multi-purpose function for such determinations [11]. Xu et al. [12] have previously analysed and validated the quantification of carotenoids from carrots and catechins from green tea on TLC plates using imaging software such as ImageJ. A different application method of ImageJ was also successfully used by Sowers et al. [13] to quantify medroxyprogesterone acetate via TLC. A further use of ImageJ has also been applied to determine the carbohydrate content in honey, garlic powder and onion juice [14].

The purpose of this paper is to assess the potential of digital image analysis, utilizing an inexpensive and simple method for the identification and quantification of ibuprofen pharmaceutical products, as an extension of the TLC method recommended by the European Pharmacopoeia (Ph. Eur.).

2 Experimental

2.1 Chemicals and reagents

All solvents used were of analytical grade [American Chemical Society (ACS), International Organization for Standardization (ISO), Reag. Ph. Eur.], consisting of methanol (Merck, Hamburg, Germany), n-hexane (Th. Geyer, Renningen, Germany), acetic acid (Carl Roth, Karlsruhe, Germany) and ethyl acetate (VWR, Darmstadt, Germany). Standard ibuprofen was obtained from Caesar & Loretz GmbH (Hilden, Germany). Analysed ibuprofen tablets (Sanofi Aventis, Frankfurt, Germany) were commercially available, claiming 400 mg API. Used UV lamp (Gebr. Rettberg GmbH, Göttingen, Germany) was equipped with a short and long wavelength. Filter paper (MN 615) and 20 × 20 cm silica gel plates (Alugram® Xtra Sil G/UV254) with a 0.2 mm layer were supplied by Macherey–Nagel (Düren, Germany).

2.2 Preparation of ibuprofen solutions

Reference solution of ibuprofen was prepared by weighing out 100 mg of ibuprofen and dissolving it in 10 mL of methanol. Appropriate volumes were then transferred to a 20 mL snap-cap vial and diluted to 5, 4 and 3 mg/mL.

A 400 mg ibuprofen tablet was wrapped in aluminium foil and pulverised to prevent a loss of mass during transfer from mortar to flask. The tablet was then dissolved in 40 mL methanol for 15 min and filtered using medium-porosity cellulose filter paper (MN 615). An appropriate volume was transferred to a 20 mL snap-cap vial and diluted to 5 mg/mL for the sample solution.

2.3 Chromatographic conditions

Silica gel plates were cut to 10 × 20 cm to allow the development of several plates simultaneously. A spotting line was marked leaving 1 cm space from the bottom and edges, additionally pre-marking the solvent front line 7 cm from the origin line. Local calibration spots for the TLC plates were then applied in a row using 2 μL capillary tubes. Three spots of the reference solution (5, 4 and 3 mg/mL) were applied, followed by two spots (5 mg/mL) of the sample solution. The mobile phase was prepared following recommendations by the Ph. Eur. and consisted of acetic acid, ethyl acetate and n-hexane (5:24:71, V/V), saturating the chamber for 20 min before use. After development, the plate was dried at room temperature and visualised under shortwave UV light (254 nm).

2.4 Image settings

Several images of the plates were taken with a smartphone (Samsung Galaxy S22, Android 13; Suwon, South Korea) using different image settings and file formats. The camera array of the smartphone was equipped with a triple camera system with different image sensor sizes (50 MP, 12 MP and 10 MP). Images were taken by hand, resting the smartphone above the UV lamp and aligning the viewfinder grid to the spotting lines. First, two images were taken using the main camera app and the 12 MP sensor without any further adjustments (images 1 and 2). Then, images were taken using the smartphone’s 50 MP sensor. Lastly (image 3), an image using the Pro mode within the camera app (version 13.1.01.9) was taken, with the ISO set to the lowest possible setting (ISO = 50), thus limiting the light sensitivity. In addition, shutter speed and exposition were locked to prevent changes in brightness and shutter speed during image acquisition. All images of ibuprofen plates were taken in a dark room, visualising under UV light at a wavelength of 254 nm. The images were not subjected to any standardisation, resulting in images with an approximate, even illumination using an automatic focus. For analysis image sets sharing the same image settings (ISO = 50; exposure bias = 0.0 eV; f-stop = f/1.8; exposure time = 1/30 s; focal length = 5 mm; 35 mm focal length = 23 mm) were then selected.

2.5 Image analysis

Following the scheme shown in Fig. 1, the selected images were imported to Fiji (File > Open) and cropped using the rectangle tool according to the spotting pattern. Splitting the colour channels (Image > Color > Split Channels) results in three image variants of the corresponding channel (red, green, blue) in 8-bit format. The green colour channel was selected for further analysis and then cropped to fit the band area. Then, a median blur of 5 px (Process > Filters > Median) and smoothing (Process > Smooth) were applied. Additionally, a bandpass filter (Process > FFT > Bandpass filter) was used, filtering larger structures down to 100 px and smaller structures up to 0 px. For better visibility, the look-up table (LUT) was inverted (Image > Color > Invert LUTs). Visual bands were then selected using the rectangular selection tool and a plot profile was drawn using the gel analyser (Analyze > Gels > Plot Lanes). The corresponding peak areas were fitted using the line selection tool and then measured using the wand tool. For more information of using on using the gel analyser, see the ImageJ user guide [15]. Finally, the percentage was displayed using Analyze > Gels > Label Peaks. Using the 5 mg/mL reference solution as the standard, the relative density of each band was fitted and plotted against the known concentration, using open source software Jamovi and the ggplot2 package in R Studio [16,17,18].

Fig. 1
figure 1

Method proposal for ibuprofen quantification using digital image processing software (Fiji)

2.6 Data analysis

2.6.1 Linearity

Good linearity could be found within the subjected images of plate 2 (R2 = 0.996, 0.984 and 0.994) as shown in Fig. 2. Applying the same method to the images in TIFF and RAW image format resulted in a non-ideal linearity (R2 < 0.95) when analysed with a concentration range from 3 to 5 mg/mL, thus the usage of these image files was deemed as unsuitable for the same method.

Fig. 2
figure 2

Linearity plots of plate 2: three images were subjected to analysis across three measurements (n = 3)

2.6.2 Accuracy

Accuracy was measured as the mean relative density of each image across the various measurements used to calculate the mean recovery of known concentrations. This resulted in accuracies of 100 ± 1.43%, 99.9 ± 3.24% and 100 ± 1.94% for the reference solution as presented in Table 1. By comparison, the analysed sample solutions resulted in accuracies of 98.1 ± 2.91%, 98.0 ± 1.86% and 98.8 ± 1.74%.

Table 1 Linearity parameters of plate 2 over three measurements of each image (n = 3)

2.6.3 Limitation

Limit of detection (LOD) and limit of quantification (LOQ) were calculated following recommendations by the International Council for Harmonisation (ICH), where \(LOD= 3.3\times (\sigma /slope)\) and \(LOQ=10\times (\sigma /slope)\) [19]. The use of a small sample size and linear range for the calibration curve can limit the significance of LOD and LOQ. While the detection and quantification limits matched the applied samples of image 1 and 3, the LOQ of image 2 was higher than the spotted concentrations.

2.6.4 Repeatability

Several images of the plates were taken and selected for analysis. User error can occur whilst cropping the peak areas. Thus, selected images were subjected to repeated measurements to ensure repeatability throughout one image. The procedure of selecting band area, application of filters and manually cropping peak areas was repeated three times for these images. Relative standard deviation (RSD) was measured for repeatability, with an RSD between images of 1.43%, 3.24% and 1.94%.

3 Results and discussion

3.1 Ibuprofen quantification

Using a minimal local calibration curve, ibuprofen concentration was determined by measuring the peak areas of the spotted sample. In addition to fixed concentrations, different spotting patterns such as repeated spotting of the same concentration and thus the application of a higher mass per spot was analysed in preliminary studies. Repeated spotting and spotting of fixed concentrations resulted in a larger developed area. Although linearity could be determined, the developed spots on the plates with the repeated spotting pattern tended to spread into each other, limiting the analysis of the spots. Using three local calibration spots with pre-set concentrations offered a more appropriate approach towards determination of sample spots and was applied for further analysis.

3.2 Potential errors

Quantification of ibuprofen was possible throughout most images. The images of plate 1 showed a single image with an R2 < 0.95 without any further adjustment. The outer spots on the plates were liable to produce a higher error during development, resulting in a lower peak area and percentage of spotted samples as expected. Images with good linearity resulted in a mean sample recovery of 106 ± 1.79%. Contrast adjustments were made as described in the following Sect. 3.3: 3.3 Digital image analysis, improving sample recovery to an average of 101 ± 3.16% (Table 2). A more accurate determination was obtained with plate 2 where a mean recovery of 98.3 ± 2.17% was measured without any further adjustments. Plate 2 was therefore subjected for further analysis of the proposed method.

Table 2 Plate comparison of mean recovery with and without contrast adjustment

Impurities on the plate can cause small bright spots on the images, which appear more prominent after filters have been applied, thus affecting determination. The subtraction of the background with built-in tools was considered unsuitable for the method used, as plate impurities seemed to affect accumulated grey area of certain bands. The usage of such delivered varying results and was no longer applied.

The use of a UV lamp can result in uneven illumination of the subjected plates. Cutting of the plate into individual plates with a fixed spotting pattern ensured a more uniform illumination. The illumination of the plates tended to alter the determination of certain spots. Applying a plot profile (Analyze > Plot Profile) allowed a quick visualisation of the image illumination and differentiation from the baseline. A curved baseline indicates an uneven illumination of the selected image area. In addition, the use of filters and processing was used to counteract the uneven illumination, as described in the following Sect. 3.3: 3.3 Digital image analysis. Image processing in a dark room offered reliable images unaffected by ambient lighting, although the addition of a black box or cradle system can ensure the standardisation of the UV illuminated plates, reducing potential errors due to uneven illumination [9, 12].

3.3 Digital image analysis

Images captured with the smartphone used in the study are stored in an RGB colour space with three different colour channels (red, green and blue) in a 24-bit format at a resolution of 3000 × 4000 pixels. When analysing the three colour channels, the green and blue channels had the most image data. The green channel provided a clearer distinction between the compound and the background fluorescence under UV illumination and was therefore used for further analysis. By splitting the colour channels and analysing the green channel in 8-bit colour space, it was possible to display the light intensity of the exposed spots. A median blur was then applied to reduce the image noise, additionally smoothing the image by replacing each pixel with the average of its neighbourhood. Applying the bandpass filter reduces edge artefacts and removes high and low spatial frequencies, additionally counteracting the uneven illumination [15]. As shown in Fig. 3, these processes produce distinguishable spots on the plate that can then be determined using the gel analyser.

Fig. 3
figure 3

Comparison between the TLC images of plate 2 before and after the application of the process in Fiji (left: images taken; right: images after applying filters in Fiji). The applied spots from left to right: reference solution 5 mg/mL, 4 mg/mL, 3 mg/mL, followed by two spots of sample solution 5 mg/mL

While determination is possible using different filters and processes (e.g. different blurring methods, order of application, different colour spaces), the distinction between baseline grey and accumulated grey needed to be clearly visible for manual cropping. Adjusting the contrast or subtracting the background resulted in a clear definition of the spots for peak area determination, with the consequence of losing image data and producing higher errors during determination. Contrast adjustments (Image > Adjust > Brightness/Contrast) were made as the outer band of plate 1 showed poor recovery. The adjustment resulted in a more accurate recovery for plate 1, as presented in Table 2, although adjustments on plate 2 did not improve the recovery rate.

The gel analyser in Fiji is suited for the densitometric assay of electrophoresis gels and limited by a fixed selection size and height for the bands [15]. Therefore, the largest band should be selected first, as a reference, to ensure that all bands are within the selection area. Manual cropping of the respective peak areas was deemed a potential user error for linearity. Standard output of the gel analyser can be edited by raising the vertical scale (Analyze > Gels > Gel Analyzer Options), resulting in a clearer distinction of the respective peak area.

3.4 Limitations of the method

In addition to applied filters in Fiji, different file formats were also analysed in preliminary studies. Originally, all images were saved in Joint Photographic Experts Group (JPG) format, containing less image data because of compression. Raw images were also taken, analysing the raw image format in addition to the Tagged Image File Format (TIFF). Image files with more data and less compression resulted in higher errors when subjected to the method. Therefore, the images taken with the 50 MP sensor were not considered to be suitable for this method. Depending on illumination, the spotted sample tended to develop a higher density compared with the reference standard of the same concentration, deeming these image files as unsuitable for this method. Although the JPG files showed less image data, the application of filters resulted in more distinguishable peak areas from the baseline.

Furthermore, this method was only applied to ibuprofen tablets. Other dosage forms such as suppositories and syrups were not analysed. Potential co-eluting substances, such as lactose monohydrate, were not taken into consideration as the applied method was an extension of the TLC method recommended by the Ph. Eur., using methanol as the solvent as recommended by the German Drug Codex (DAC) [20]. Concentration ranges of the solution were analysed in the range of 3 to 5 mg/mL to follow the preparation steps as recommended by the Ph. Eur. standards. Further studies should therefore be carried out to analyse the applicability of other dosage forms and the effect of co-eluting substances should therefore be investigated.

4 Conclusions

The method presented can be used to quantify ibuprofen in pharmaceutical dosage forms such as tablets. Although linearity and accuracy can be achieved using different file formats, the proposed method is best suited for the digital analysis of JPG files. This method can be used in preliminary studies or curricula owing to its low cost and minimal equipment requirements. The proposed method is less time consuming than titration quantification and allows post-hoc analysis using digital imaging. In addition, multiple samples can be spotted and quantified simultaneously. The applicability of the method can also be extended by ensuring standardisation using a black box. Furthermore, an analysis of low- to mid-range smartphone camera systems should be considered to extend the scope of this approach.