Weld quality inspection allows the detection of defects that may compromise the quality and strength of the weld. Although visual optical inspection offers lower reliability than other non-destructive methods, it enables weld analysis at a significantly lower cost. In this context, developing machine learning-based algorithms for automatic optical weld quality recognition requires acquiring large amounts of data for training. This entails high costs in terms of time, material and energy required for test preparation. However, one possible approach to tackling the problem with limited datasets is to use synthetic data. Using such data increases the amount and variety of data available to the detection algorithm. With a focus on the context of welding, this paper presents an approach that uses synthetic data as a form of data augmentation to improve the performance of the optical detection of weld seams. Specifically, we propose a generative neural network for semantic image synthesis using a limited starting dataset. The network generates new data instances by receiving as input a semantic map of the image to be represented. Weld defects such as porosity or weld spatter are added to the semantic map so that the network synthesizes corresponding defect images. Analysing the performance on a segmentation network, experimental results show how adding synthetic data to the original data can ensure improvements in network performance.