In this era of COVID19, proper diagnosis and treatment of pneumonia are very important. Chest X-Ray (CXR) image analysis plays a vital role in the reliable diagnosis of pneumonia. An experienced radiologist is required for this. However, even for an experienced radiographer, it is quite challenging and time-consuming to diagnose accurately due to the fuzziness of CXR images. Also, identification can be erroneous due to the involvement of human judgement. Hence, an authentic and automated system can play an important role here. In this era of cutting-edge technology, deep learning (DL) is highly used in every sector. There are several existing methods to diagnose pneumonia but they have accuracy problems. In this study, an automatic pneumonia detection system has been proposed by applying the extreme learning machine (ELM) on the Kaggle CXR images (Pneumonia). Three models have been studied: classification using extreme learning machine (ELM), ELM with a hybrid convolutional neural network-principal component analysis (CNN-PCA) based feature extraction, and CNN-PCA-ELM with the CXR images which are contrast-enhanced by contrast limited adaptive histogram equalization (CLAHE). Among these three proposed methods, the final model provides an optimistic result. It achieves the recall score of 98% and accuracy score of 98.32% for multiclass pneumonia classification. On the other hand, a binary classification achieves 100% recall and 99.83% accuracy. The proposed method also outperforms the existing methods. The outcome has been compared using several benchmarks that include accuracy, precision, recall, etc.