The main task of creating new digital images of different skin diseases is to increase the resolution of the specific textures and colors of each skin disease. In this paper, the performance of generative adversarial networks has been optimized to generate multicolor and histological color digital images of a variety of skin diseases (melanoma, birthmarks, and basal cell carcinomas). Two architectures for generative adversarial networks were built using two models: the first is a model for generating new images of dermatology through training processes, and the second is a discrimination model whose main task is to identify the generated digital images as either real or fake. The gray wolf swarm algorithm and the whale swarm algorithm were relied on to generate values that improve the performance of GANs and insert them into the generator instead of random values, which in turn worked to reduce the loss values for the generated images. Loss values were adopted as a measure of optimizations for each epoch, and the fastest access time to actual digital images for each skin disease was adopted. Before the optimization operations, 50% accurate images of skin diseases were obtained; after the optimization operations, 98% accurate images of skin diseases were obtained.